0
异步视界/archive/emacs-tramp-hangs-bug-in-zsh
· ARTICLE · 2012.07.04 · 2 MIN ·

解决Emacs远程连接时卡住的bug

解决Emacs远程连接时卡住的bug · by fancyoung
AI · HERO seed:2820120704 解决Emacs远程连接时卡住的bug
FIG.00 — cover · ai-generated · placeholder

前几天终于买了Linode的VPS,配置过程中遇见一个灵异问题:
Emacs无法远程SSH编辑文件,状态一直卡在Tramp: Waiting for prompts from remote shell

折腾了好久,终于定位到zsh的配置oh-my-zsh上。
最后查到原来Emacs Wiki上已经有解决方案,在.zshrc底部加上:

if [[ "$TERM" == "dumb" ]]
then
  unsetopt zle
  unsetopt prompt_cr
  unsetopt prompt_subst
  unfunction precmd
  unfunction preexec
  PS1='$ '
fi

参考:TrampMode Troubleshooting