Eventually I was able to get what I wanted with the following in my .emacs file.
(progn
(interactive)
(split-window-horizontally)
(other-window 1)
(split-window)
(other-window 1)
(eshell)
(other-window 1)) ;; finally change back to scratch window
;; open temporary buffers in a dedicated window split
(setq special-display-regexps
'("^\\*Completions\\*$"
"^\\*Help\\*$"
"^\\*grep\\*$"
"^\\*Apropos\\*$"
"^\\*elisp macroexpansion\\*$"
"^\\*local variables\\*$"
"^\\*Compile-Log\\*$"
"^\\*Quail Completions\\*$"
"^\\*Occur\\*$"
"^\\*frequencies\\*$"
"^\\*compilation\\*$"
"^\\*Locate\\*$"
"^\\*Colors\\*$"
"^\\*tumme-display-image\\*$"
"^\\*SLIME Description\\*$"
"^\\*.* output\\*$" ; tex compilation buffer
"^\\*TeX Help\\*$"
"^\\*Shell Command Output\\*$"
"^\\*Async Shell Command\\*$"
"^\\*Backtrace\\*$"))
(setq grb-temporary-window (nth 1 (window-list)))
(defun grb-special-display (buffer &optional data)
(let ((window grb-temporary-window))
(with-selected-window window
(switch-to-buffer buffer)
window)))
(setq special-display-function #'grb-special-display)
I found what I needed in this .emacs file on github.
https://github.com/garybernhardt/dotfiles/blob/master/.emacs
I worked out an approach that lets you find out specifically what terminals are available on the remote host and then set it. Usually, there is at least one ansi compatible terminal, so a 'hack' to fake it should be unnecessary.
Done in one long'ish ssh command, it will look something like this:
ssh -i ~/.ssh/some_key.pub -tty some_remote_server "export TERM=`ls -1R /usr/share/terminfo | grep ^eterm-color$ || ls -1R /usr/share/terminfo | grep ^aterm$ || ls -1R /usr/share/terminfo | grep ^ansi$ || ls -1R /usr/share/terminfo | grep ^xterm-256color$ || export TERM=xterm && emacs -nw"
This finds different ansi compatible (and non-compatible) terminal types in an order of preference on the remote host and sets the first one found before launching EMACS. It sets TERM to use 'xterm' type if none of our preferred types are found, ensuring EMACS does actually launch.
In this example, I am looking for eterm-color, aterm, ansi, and xterm-256color in that order. I am not a heavy EMACS user, so not sure those are actually the best. I tested this launch on CentOS and worked well (it found eterm-color in my testing).
I believe the terminfo is in the same place on most/all Linux variants, but you can add more paths to search the same way you would add more terminals, by adding more
|| ls -1R /a/different/path | grep ^someotherterminal$
conditional test and pipes.
Best Answer
(Emacs info file, "Term mode")