Emacs 远程外壳 [英] Emacs remote shell

查看:31
本文介绍了Emacs 远程外壳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我倾向于在 emacs 中运行我的 shell,但是当我用它 ssh 到另一台计算机时,这会破坏 tab-completion.有没有办法解决这个问题?

I tend to run my shell in emacs, but when I use it to ssh into another computer this breaks tab-completion. Is there a way to fix this?

推荐答案

尝试:

M-x cd /hostname:/current/path/in/the/shell

那应该设置ange-ftp(或tramp),然后路径的TAB补全应该适用于该shell - 直到您登录到另一台机器.

That should set up ange-ftp (or tramp), and then TAB completion for paths should work properly for that shell - until you log into a different machine.

您可以设置一个 comint 进程过滤器来识别您何时键入 ssh 以自动为您执行此操作,但很难做到正确,因为它应该在您退出 ssh<时恢复/code> 会话,但不会被 exit 的其他用途所欺骗.

You could set up a comint process filter to recognize when you type ssh to do that for you automatically, but that's difficult to get right as it should revert when you exit the ssh session, but not be tricked by other uses of exit.

对于自动化解决方案,我建议增加 我个人使用的方法 使 Emacs 与 shell 缓冲区的当前工作目录保持同步.只需在主机名中添加一些额外的信息,并使用它来设置主机名和路径,如上所示.

For an automated solution, I'd suggest augmenting the approach I personally use to keep Emacs synchronized with the current working directory of the shell buffer. Just add an an extra bit of information with the hostname, and use that to set the hostname and path like shown above.

这篇关于Emacs 远程外壳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆