Open twagtwig opened 4 years ago
I have at the beginning of my remote .rc
file the following lines:
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
So the rest of the file is not evaluated and the prompt stays extremely simple.
However, this problem caused multiple headaches to me and to people I know (not necessarily with vterm), so I'll add a note in the README.
Thank you @Sbozzolo , I have that line too in my .bashrc
on the server but after some testing it doesn't have any effect on TRAMP for me.
I still got errors like:
Tramp: Waiting for prompts from remote shell...failed
Tramp: Opening connection for root@server using ssh...failed
The only thing that worked for me is
In emacs: (setq tramp-shell-prompt-pattern "\\(?:^\\|\r\\)[^]#$%>\n]*#?[]#$%>].* *\\(^[\\[[0-9;]*[a-zA-Z] *\\)*")
In .bashrc
on the remote server:
vterm_prompt_end(){
vterm_printf "51;Auser@server:$(pwd)"
}
(Where I replace "user" and "server" with the terms ssh is expecting from my local .ssh/config
. Using $(whoami)@$(hostname) didn't work for me because I use an alias in my ssh config.
I have to include the following to get
dired-jump
, andfind-file
to correctly start on the remote server (from a vterm buffer already ssh'd-in):I got it from https://github.com/akermu/emacs-libvterm/issues/55#issuecomment-472255904 The remote server is Debian 10 cloud.
Can anyone confirm that setting
tramp-shell-prompt-pattern
is necessary to connect to a remote server with the full shellside configuration from the README?For reference, here's what I have in my shell on the server:
If this is the case, I suggest including something about it in the README.
This is in the spirit of https://github.com/akermu/emacs-libvterm/issues/237
A sentence in the https://github.com/akermu/emacs-libvterm#directory-tracking-and-prompt-tracking section like: