TRAMP忽略流浪者远程路径

编程入门 行业动态 更新时间:2024-10-23 23:26:23
本文介绍了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忽略流浪者远程路径

本文发布于:2023-10-07 12:54:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1469442.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:流浪者   路径   TRAMP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!