【发布时间】:2018-09-14 13:47:41
【问题描述】:
在 Windows 上使用 emacs Tramp,我正在尝试远程登录到 Windows PC。它发出以下 plink 命令失败(在 emacs 和 cmd.exe 上)
而 putty 给了我一个会话。我想通过emacs使用它。 我需要做什么才能使其在 Windows 上的 Tramp 上运行。
注意:我已经尝试过一个 SO 答案中提到的字节编译文件 tramp-sh.el 修复。通过 Git MSys2 更新为使用 Emacs 26.1(我们可以说是最小的 cygwin)。参考了更多答案,并没有为目标 Windows PC 找到太多帮助。任何帮助指针表示赞赏。
cmd.exe:
C:\Users\myUser>plink -v -l int***** -ssh -t inpu******* " env 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=
#$ ' ssh " && exit | exit
...
...
Sent password
Access granted
Opening session as main channel
Opened main channel
Allocated pty (ospeed 38400bps, ispeed 38400bps)
Started a shell/command
/bin/sh: env: command not found
Server sent command exit status 0
Disconnected: All channels closed
Emacs:
Tramp: Opening connection for int*****@inpu******* using plink...
Tramp: Sending command ‘plink -l int***** -ssh -t inpu******* " env 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=#$ ' /bin/sh " && exit || exit’
Tramp: Waiting for prompts from remote shell...
Tramp: Sending password
Tramp: Waiting for prompts from remote shell...failed
Tramp: Opening connection for int*****@inpu******* using plink...failed
更新 1: 使用 MSys2 而不是 /bin/sh 会退出 (预计会使用 MSys2 启动 shell 会话)
Sent password
Access granted
Opening session as main channel
Opened main channel
Allocated pty (ospeed 38400bps, ispeed 38400bps)
Started a shell/command
*exits here*
【问题讨论】: