If the account you're connecting to uses some weird fancy shell prompt, then there is a good chance that this is what makes tramp trip.
Log in as root, then enter
PS1="> "
(that's a normal, standard shell (ZSH, BASH, younameit) prompt, one that tramp
will understand)
then switch to the user account, and launch emacs -q
(to make sure that your .emacs
is not causing this mess) and try to C-x C-f /sudo:root@localhost:/etc/hosts
and see what's what.
You can (not recommended) also customize the regexp that defines what tramp expects :
M-x customize-variable RET tramp-terminal-prompt-regexp
My approach :
- Make sure the variable
tramp-terminal-type
is set to "dumb"
M-x customize-variable RET tramp-terminal-type
- Test that in your .*shrc and serve the correct prompt :
case "$TERM" in
"dumb")
PS1="> "
;;
xterm*|rxvt*|eterm*|screen*)
PS1="my fancy multi-line
prompt > "
;;
*)
PS1="> "
;;
esac
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…