【问题标题】:Tramp hangs after sending password发送密码后 Tramp 挂起
【发布时间】:2014-04-20 01:54:17
【问题描述】:

我正在尝试在 Emacs Tramp 中使用 plink.exe 进行 SSH。我已经下载了 plink.exe,它可以在普通终端中运行,但是当我使用时

C-x C-f

/gg88@afs1.njit.edu:/afs/cad/u/g/g/gg88/public_html/index.html

在小缓冲区中,

Tramp: Waiting for prompts from remote shell also appears.
plink.exe所在的

c:/Users/name/emacs-24.3/bin在exec-path中。我的 .emacs 仅包含这些行。但是在检查 exec-path 后确实包含 plink.exe 所在的目录。

(require 'tramp)
(setq tramp-default-method "plink")

使用m-x eshell也没有问题,进入c:/Users/name/emacs-24.3/bin,运行

plink.exe gg88@afs1.njit.edu

接下来我该怎么做才能让它发挥作用?

编辑 通过将 plink 的路径直接添加到 PATH 变量来识别 plink,但仍然有

 Tramp: Waiting for prompts from remote shell also appears.

问题

Edit2 消息缓冲区

Tramp: Opening connection for gg88@afs1.njit.edu using plink...
Tramp: Sending command `plink -l gg88  -ssh afs1.njit.edu && exit || exit'

Tramp: Waiting for prompts from remote shell
Tramp: Sending Password
Tramp: Waiting for prompts from remote shell [7 times]
Tramp: Sending command `plink -l gg88  -ssh afs1.njit.edu && exit || exit'
Tramp: Opening connection for gg88@afs1.njit.edu using plink...done
Quit [2 times]

【问题讨论】:

  • OT1H 您说“我已将 plink.exe 所在的目录添加到 exec-path”,但 OTOH 您显示的 .emacs 不会触及 exec-path。它是哪一个?顺便说一句,Tramp 默认是启用的,所以你不需要(require 'tramp)
  • 我使用了 (add-to-list 'exec-path "C:/Users/name/emacs24-3/bin") 其中 plink.exe 在 bin 中。它不在 .emacs 中,但是当我使用 C-h v exec-path 检查它的值时,该路径仍然存在。
  • 最终通过将 plink 添加到 PATH 变量中来识别 plink,但 Tramp: Waiting for prompts from remote shell 也会出现。仍然是个问题

标签: emacs emacs24 plink tramp


【解决方案1】:

首先,我的~/.emacs.d/bin 中有 plink.exe

然后我将所有内容包装在我的emacs-24 目录中的runemacs.bat 文件中:

SET HOME=D:\\benoit
SET PATH=%PATH%;%HOME%\.emacs.d\bin
start %CD%\bin\runemacs.exe

而且它有效。 有时用于 windows / tramp / putty / 任何混乱的 emacs,所以我运行 tramp-cleanup-all-connections 以获得新的开始。 tramp 与 emacs 24.2 捆绑在一起是可以的,但是 24.3 的那个是错误的,所以你可能需要手动更新它。

【讨论】:

  • 我尝试了这个解决方案,但仍然出现消息“Tramp:Waiting for prompts from remote shell”。我认为问题可能与寻找登录提示的正则表达式有关。
猜你喜欢
  • 1970-01-01
  • 2013-12-20
  • 1970-01-01
  • 2012-12-19
  • 1970-01-01
  • 2013-03-19
  • 1970-01-01
  • 2011-03-22
  • 2015-04-20
相关资源
最近更新 更多