![Emacs24:tramp 不再与 plink 兼容](https://linux22.com/image/1374077/Emacs24%EF%BC%9Atramp%20%E4%B8%8D%E5%86%8D%E4%B8%8E%20plink%20%E5%85%BC%E5%AE%B9.png)
自从 Emacs 22 以来,我一直使用 Emacs+tramp+plink 在远程 Unix 服务器上编辑文件。最近我将我的 Emacs 升级到 24,发现它不再起作用了......它说它找到了远程 shell 提示符,但只是卡在那里。
下面是我的 tramp 配置,它在 Emacs 23 中运行完美:
(require 'tramp)
(modify-coding-system-alist 'process "plink" 'utf-8-unix)
(setq tramp-default-method "plink"
tramp-completion-without-shell-p t)
(setq tramp-verbose 10)
(setq tramp-debug-buffer t)
我有一个 putty/plink 配置文件“lab”,它指向一个远程 Unix 服务器。我像这样在远程服务器上打开该文件:
/plink:myaccount@lab:/home/myaccount/somefile.txt
从 tramp 调试日志中,我可以看到 tramp 发现了远程 shell:
17:45:58.430000 tramp-get-connection-property (7) # check-remote-echo nil
17:45:58.430000 tramp-process-one-action (5) # Call `tramp-action-process-alive'
17:45:58.430000 tramp-accept-process-output (10) # *tramp/plink myaccount@lab* run
17:45:58.476000 tramp-accept-process-output (10) #
plink -l myaccount -ssh lab && exit || exit
Last login: Wed Aug 14 17:43:54 2013 from 192.168.0.1
Unauthorized access to this system is strictly prohibited.
[myaccount@unixhost ~]$
问题是,tramp 似乎陷入了无限循环:
17:45:58.476000 tramp-get-connection-property (7) # process-buffer nil
17:45:58.492000 tramp-maybe-open-connection (3) # Found remote shell prompt on `lab'
17:45:58.492000 tramp-get-connection-property (7) # remote-shell nil
17:45:58.492000 tramp-open-shell (5) # Opening remote shell `/bin/sh'...
17:45:58.492000 tramp-get-connection-property (7) # process-name nil
17:45:58.492000 tramp-get-connection-property (7) # remote-echo nil
17:45:58.492000 tramp-send-command (6) # exec env ENV='' PROMPT_COMMAND='' PS1=\#\$\ PS2='' PS3='' /bin/sh
17:45:58.492000 tramp-get-connection-property (7) # process-name nil
17:45:58.492000 tramp-get-connection-property (7) # chunksize nil
17:45:58.492000 tramp-set-connection-property (7) # last-cmd-time (21003 17350 492000 0)
17:45:58.492000 tramp-send-string (10) # exec env ENV='' PROMPT_COMMAND='' PS1=\#\$\ PS2='' PS3='' /bin/sh
17:45:58.492000 tramp-get-connection-property (7) # process-buffer nil
17:45:58.492000 tramp-get-connection-property (7) # check-remote-echo nil
17:45:58.492000 tramp-get-connection-property (7) # check-remote-echo nil
17:45:58.492000 tramp-accept-process-output (10) # *tramp/plink lum@lab* run
17:45:58.539000 tramp-accept-process-output (10) # exec env ENV='' PROMPT_COMMAND='' PS1=\#\$\ PS2='' PS3='' /bin/sh
#$ #$
17:45:58.539000 tramp-get-connection-property (7) # check-remote-echo nil
17:45:58.539000 tramp-get-connection-property (7) # check-remote-echo nil
17:45:58.539000 tramp-accept-process-output (10) # *tramp/plink lum@lab* run
17:45:59.539000 tramp-accept-process-output (10) # exec env ENV='' PROMPT_COMMAND='' PS1=\#\$\ PS2='' PS3='' /bin/sh
#$ #$
这将需要很长时间,直到我使用 ctrl-g 来中断它。
不知道哪个部分出了问题,完全相同的配置在 Emacs 23 下再次完美运行......