本文介绍了Emacs:Tramp不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我试图通过Tramp通过Emacs打开一个远程文件。 (require'tramp)(setq tramp-default-methodssh) 我收到Emacs的消息 Emacs挂起没有回应任何操作之后 Emacs安装在Windows上;远程文件位于Linux机器上。解决方案如果您连接的帐户使用了一些奇怪的外壳提示,有一个很好的机会,这是什么让流浪汉旅行。 以root身份登录,然后输入 PS1 => (这是一个普通的标准shell(ZSH,BASH,younameit)提示,一个流氓将理解)然后切换到用户帐户,并启动 emacs -q (以确保您的 .emacs 不会导致这个混乱),并尝试 Cx Cf / sudo:root @ localhost:/ etc / hosts 您可以(不推荐)还自定义正则表达式,定义了邮件预期的内容: Mx自定义变量RET tramp-terminal-prompt-regexp 我的方法: 确保变量 tramp-terminal-type 设置为哑 Mx自定义变量RET tramp-terminal-type 测试您的。* shrc并提供正确的提示: I tried to open a remote file via Emacs via Tramp.(require 'tramp)(setq tramp-default-method "ssh")I get a message from EmacsEmacs hung and did not respond to any action after thatEmacs was installed on Windows; the remote file was on a Linux machine. 解决方案 If the account you're connecting to uses some weird fancy shell prompt, then there is a good chance that this is what makes tramp trip.Log in as root, then enter PS1="> "(that's a normal, standard shell (ZSH, BASH, younameit) prompt, one that tramp will understand)then switch to the user account, and launch emacs -q (to make sure that your .emacs is not causing this mess) and try to C-x C-f /sudo:root@localhost:/etc/hosts and see what's what.You can (not recommended) also customize the regexp that defines what tramps expects :M-x customize-variable RET tramp-terminal-prompt-regexpMy approach :Make sure the variable tramp-terminal-type is set to "dumb"M-x customize-variable RET tramp-terminal-typeTest that in your .*shrc and serve the correct prompt : 这篇关于Emacs:Tramp不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-11 14:52