Subject: bug#71267: [TRAMP] Tramp/Emacs does not pick up PATH from login shell via Distrobox method

From: Michael Albinus <[email-masked]>
Date: Thu, 30 May 2024 12:22:39 +0200

Alexis Purslane via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <[email-masked]> writes:

Hi Alexis,

> 1. Start emacs -Q.
> 2. Evaluate the forms
>     (require 'tramp)
>     (load "path/to/tramp-2.7.1/tramp-container.el")
>     (tramp-enable-distrobox-method)
> 3. `cd' to an `/distrobox:' location via eshell, or use find-file to
>     open a file through a distrobox so that your default-directory is in
>     it.
> 4. Observe the PATH according to Emacs
> 5. Then run sh -l in that distrobox (either by doing distrobox enter on
>     an external shell, or via eshell). Obeserve the PATH according to
>     distrobox.
> 6. Check the /etc/profile* files inside the distrobox to see which is
>     correct.

See the Tramp manual at (info "(tramp) Remote programs")

You need to add tramp-own-remote-path to tramp-remote-path as described there.

Best regards, Michael.