3 ms·
Probably not the answer You are looking for... Try some variant of this in your remote .bash_profile or what-not: if [ "$PS1" ]; then export PS1='\h:\
by Rediscover 3y ago
Probably not the answer You are looking for...
Try some variant of this in your remote .bash_profile or what-not:
if [ "$PS1" ]; then
export PS1='\h:\w\$ '
if [[ "x${TERM}" = "xeterm" || "x${TERM}" = "xeterm-color" ]]; then
function set-eterm-dir {
echo -e "\033AnSiTu" $(whoami)
echo -e "\033AnSiTc" $(pwd)
echo -e "\033AnSiTh" $(hostname -f)
}
PROMPT_COMMAND=set-eterm-dir
fi
fi
Now, locally, invoke M-x ansi-term, then within the ansi-term ssh to the remote machine. Change dirs, hit C-x C-f to open a file in the current (remote) directory.
See also the ansi-term hints on emacswiki
https://www.emacswiki.org/emacs/AnsiTermHints#h5o-5 https://www.emacswiki.org/emacs/AnsiTermHints#h5o-5
or the comments in /usr/local/share/emacs/*/lisp/term.el
Edit: formatting
- Rediscover 3y agoApologies, I meant to add more saying I could not get a remote machine to invoke the local emacs reliably. I got close with hacking up emacsclient to ssh back, but was eventually stymied by new network policies at $JOB and eventually settled for the above. db48x has a great answer below.