[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Behavior of tramp-own-remote-path

From: Michael Albinus
Subject: Re: Behavior of tramp-own-remote-path
Date: Wed, 30 Dec 2020 11:52:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Augusto Stoffel <> writes:

Hi Augusto,

I'm sorry to reply such late, but there was Xmas, and I had also to
release Tramp 2.5.0.

> I've recently posted a question on Stack Exchange about the way Tramp
> sets the PATH [1].  I would set tramp-remote-path to the value
> '(tramp-own-remote-path) but Tramp would still not make the PATH
> identical to what I get in a direct ssh login.
> The problem, it turns out, was due to my PATH being set up in
> ~/.bashrc instead of ~/.profile.  More specifically, Tramp inquires
> the remote machine's PATH with the command
>    /bin/sh -l -c 'echo $PATH'
> which, I assume, will run some of the /etc/profile.d scripts for a
> second time.  As a side effect, some low priority entries of PATH got
> pushed to the front.

Not really. In recent Tramp versions, it calls what is set in connection
property "remote-shell" if set. If it is "/usr/bin/bash", that is
called. "/bin/sh" is just the fallback.

> I wonder if there is something against querying the PATH with the
> command
>    /bin/echo $PATH
> This would have at least the advantage of making the path set-up
> more predictable.

Tramp has a long tradition to mistrust $PATH on a remote machine, many
bug reports tell about. So instead of not knowing what is set there in
which shell, it allows you to say exactly what you want. If you want
bash, say it via the "remote-shell" connection property. This protects
you also yourself against different login shells on different machines,
which you don't remember.

> Best regards,
> Augusto

Best regards, Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]