【问题标题】:Emacs Tramp hangs on 'enter' key after inputing password输入密码后,Emacs Tramp 挂在“输入”键上
【发布时间】:2013-11-04 15:42:28
【问题描述】:

我尝试了 C-x C-f '/ssh:user@host:/some/file',输入密码后,我的确认 'enter' 没有得到回复。

从 OS X 到 archlinux 机器,而 ssh 在 emacs 之外工作。

我设置 PS1="> ",并在 root shell 中使用 'emacs -q',而 C-x C-f '/sudo:root@localhost:/' 成功,C-x C-f '/ssh:user@host:/' 也失败了。

Tramp-verbose 设置为 10 并提供此类信息。

12:25:46.141981 tramp-accept-process-output (3) # Opening connection for SOMEUSER@SOMEIP using ssh...done
12:25:46.142129 tramp-get-connection-property (7) # process-name nil
12:25:46.142269 tramp-flush-connection-property (7) # [ssh SOMEUSER SOMEIP nil] (first-password-request)
12:25:46.142420 tramp-flush-connection-property (7) # *tramp/ssh SOMEUSER@SOMEIP* (vector temp-file last-cmd-time)
12:25:46.142670 tramp-get-connection-property (7) # vector nil
12:25:46.143894 tramp-file-name-handler (1) # Interrupt received in operation (file-exists-p /ssh:SOMEUSER@SOMEIP:/home/SOMEUSER/tmp)

我在远程机器上创建了一个新用户并成功与该用户(使用 bash)连接,但我在我的主要用户的 .zhsrc 中写了“casedumb”并且也失败了,所以我无法理解。

【问题讨论】:

  • 您使用的是哪个操作系统?您连接到哪个操作系统?您使用的是哪个 SSH 客户端?你的tramp-default-method 是什么? M-x customize-variable RET tramp-verbose 可能有助于诊断。
  • OS X 到 archlinux,openssh,方法:ssh。我可以在 shell 中使用 ssh,所以我不认为这是 ssh 的问题。 tramp-verbose 仅​​返回 3(默认级别)。
  • 如果你增加详细程度,tramp 会告诉你更多关于正在发生的事情。通常,当它挂起时,您将能够知道它正在尝试做什么。
  • 当然我假设您已经将任何相关消息粘贴到问题中,但如果它告诉您它正在等待远程提示,请参阅stackoverflow.com/questions/6954479/emacs-tramp-doesnt-work
  • 感谢您的关注!但是由于emacs挂在输入上,似乎tramp-verbose无法提供信息?

标签: emacs tramp


【解决方案1】:

您说您在.zshrc 中写了愚蠢的案例。请检查它是否类似于以下构造:

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

我遇到了类似的问题。将上面的块添加到我的.zshrc 解决了这个问题。

礼貌EmacsWiki

【讨论】:

  • 谢谢你和 phils,我应该尝试所有 wiki 的东西。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-03-22
  • 2011-12-06
  • 2013-12-20
  • 1970-01-01
  • 1970-01-01
  • 2015-12-03
  • 2019-02-13
相关资源
最近更新 更多