Emacs远程shell [英] Emacs remote shell

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

问题描述

我倾向于在emacs中运行我的shell,但是当我将它用于ssh进入另一台计算机时,这会打破选项卡的完成。有没有办法解决这个问题?

解决方案

尝试:

  Mx cd / hostname:/ current / path / in / the / shell 

应该设置ange-ftp(或tramp),然后TAB完成路径应该适用于该shell - 直到您登录到另一台机器。



您可以设置一个comint过程过滤器来识别何时输入 ssh 为您自动执行此操作,但这很难正确,当您退出 ssh 会话,但不得被其他用途退出



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


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?

解决方案

Try:

M-x cd /hostname:/current/path/in/the/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.

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.

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远程shell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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