选项卡完成在Emacs的shell模式SSH会话 [英] Tab Completion In Emacs shell-mode SSH Sessions

查看:115
本文介绍了选项卡完成在Emacs的shell模式SSH会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前使用的emacs模式导致我有几个shell模式缓冲区打开,每个都运行一个ssh会话。尽管如此,当我尝试在远程会话中制作文件名和其他内容时,我遇到了一个问题,但是shell尝试使用本地机器上可用的完成,而不是在远程机器上。



例如,如果文件〜/ foobar 存在于本地机器上,〜 / froc 存在于远程计算机上,键入〜/ f ,然后按Tab键结果〜/ foobar 而不是正确完成。如果我在emacs之外使用ssh并尝试相同的东西,我可以正确地完成〜/ frob



如何在普通ssh会话中完成标签完成方式?



Mx cd RET /ssh:host.example.com:/path/to/me 也似乎推动它能够优雅地处理标签完成。

解决方案

当ssh-ing到其他机器时,emacs无法跟踪当前目录(default-direcotry)。



您可以将默认目录设置为流动文件名,如 / ssh:YOURHOST:/ home / dir

b $ b但是在远程文件中的远程跟踪中存在一个错误,该文件在trunk(未发布)中已修复。



http://comments.gmane.org/gmane.emacs.bugs/39082


My current use pattern of emacs results in my having several shell-mode buffers open, each running an ssh session. I am running into an issue with this, though - when I try to tab-complete file names and other things in my remote session, the shell attempts to use completions available on the local machine instead of on the remote machine.

For example, if the file ~/foobar exists on the local machine and ~/frob exists on the remote machine, typing in ~/f and pressing tab results in ~/foobar instead of completing correctly. If I use ssh outside of emacs and try the same thing, I get the correct completion of ~/frob instead.

How can I get tab-completion to complete the way it does in normal ssh sessions ?

Later note: M-x cd RET /ssh:host.example.com:/path/to/me also seems to nudge it into being able to gracefully deal with tab completion.

解决方案

emacs can't track the current directory (default-direcotry) when ssh-ing to other machines.

You could set default-directory to a tramp file-name like /ssh:YOURHOST:/home/dir" on your current shell-buffer manually.

I start shell-sessions on a remote maching mostly via tramp-bookmarks/shell. Tramp set's default-directory automatically. But there is a bug in direcotry tracking on remote files, which is fixed in trunk (unreleased).

http://comments.gmane.org/gmane.emacs.bugs/39082

这篇关于选项卡完成在Emacs的shell模式SSH会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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