TRAMP忽略流浪者远程路径 [英] TRAMP ignores tramp-remote-path

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

问题描述

.emacs中包含以下内容:

I have the following in my .emacs:

(require 'tramp)
(add-to-list 'tramp-remote-path "/some/path")
(add-to-list 'tramp-remote-path 'tramp-default-remote-path)

因此,当我在ssh上使用流浪汉打开文件时,我希望我的PATH包含/some/path.相反,运行M-! echo $PATH会返回

so when I open a file using tramp over ssh, I expect my PATH to contain /some/path. Instead, running M-! echo $PATH returns

/bin:/usr/bin:/usr/sbin:/usr/local/bin

即使我在.bashrc.profile中设置了export PATH=/hwdisks/data/modules/pkg/git/1.8.4.1/bin/git:$PATH,也没有正确设置PATH.

Even if I set export PATH=/hwdisks/data/modules/pkg/git/1.8.4.1/bin/git:$PATH in .bashrc or .profile, PATH is not set correctly.

在流浪汉日志*debug tramp/ssh remotehost*中,我可以看到流浪汉显式设置了PATH:

In the tramp log, *debug tramp/ssh remotehost*, I can see tramp explicitly setting PATH:

12:28:34.202135 tramp-send-command (6) # PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin; export PATH

如果我在.bashrc中包含echo "in .bashrc",它会出现在流浪汉日志中,因此我知道流浪汉正在读取它.

If I include echo "in .bashrc" in my .bashrc, it appears in the tramp log, so I know tramp is reading it.

如何使流浪汉使用正确的PATH?

How can I make tramp use the correct PATH?

Emacs版本:24.2.1
流浪汉版本:2.2.3-24.1

Emacs version: 24.2.1
Tramp version: 2.2.3-24.1

推荐答案

令人尴尬的是,答案在流浪汉手册中:

Embarrassingly, the answer is in the tramp manual:

另一种可能性是登录时重复使用远程帐户的路径设置.通常,这些设置将被覆盖,因为它们可能对流浪者没有用处.占位符tramp-own-remote-path保留这些设置.您可以通过

Another possibility is to reuse the path settings of your remote account when you log in. Usually, these settings are overwritten, because they might not be useful for tramp. The place holder tramp-own-remote-path preserves these settings. You can activate it via

(add-to-list 'tramp-remote-path 'tramp-own-remote-path)

我仍然不确定为什么它会忽略添加到tramp-remote-path的其他路径.

I'm still not sure why it ignores the other paths added to tramp-remote-path.

这篇关于TRAMP忽略流浪者远程路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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