From: Jim Porter <jporterbugs@gmail.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Jordan Wilson <jordan.t.wilson@gmx.com>, 65551@debbugs.gnu.org
Subject: bug#65551: 29.1; Eshell on MS-Windows using plink: 'plink' is not recognized as an internal or external command...
Date: Mon, 28 Aug 2023 11:01:13 -0700 [thread overview]
Message-ID: <0dcc88be-6326-f1d8-9dbc-e2bce7b8fc64@gmail.com> (raw)
In-Reply-To: <87il8zul5h.fsf@gmx.de>
On 8/28/2023 10:33 AM, Michael Albinus wrote:
> tramp-remote-path is just a template, It is taken the very first time
> you connect to a remote host in order to determine proper PATH
> settings. The result is cached in the connection property "remote-path".
Yeah, I believe this result is where we get the starting value for PATH
for remote hosts. If we don't already have a cached PATH for the remote
host in Eshell, we get it by calling '(exec-path)', which I'm guessing
uses tramp-remote-path (at least indirectly).
> If a user changes PATH for a remote connection in eshell (I don't recall
> how, but I'm sure it is possible in Eshell), you just have to change the
> respective connection property "remote-path" in Tramp.
> See (info "(tramp) Predefined connection information")
Changing the PATH is pretty simple: just run "export PATH=blah" or "set
PATH blah".
> There is an exception: If a user has the symbol tramp-own-remote-path
> in tramp-remote-path, the cached value is not used for a new process,
> and PATH is recomputed based on tramp-remote-path.
I think we want to handle this case too: for example, I use
'tramp-own-remote-path' so that I can pick up my remote hosts' PATH
values, but then I might want to change that value in Eshell later. If
Eshell let-binds and sets 'tramp-remote-path' when starting the remote
process, it can override the 'tramp-own-remote-path' setting
temporarily, which I think is what we want. We'd lose the ability for
Tramp to recompute the remote PATH on its own, but in the context of
Eshell I think that should be ok.
> Writing this, it sounds to me too complex. OTOH, no other package has
> tried yet to play with the remote PATH. There are bug reports by users
> who request a simplification (bug#61926, bug#62326). Perhaps it is time
> to redesign the machinery in Tramp.
Yeah, this is pretty tricky code to work with on both sides (both
Tramp/remote connections and Eshell). One option that might make sense
is if we could pass the environment vars for the subprocess as a key in
'make-process', like ':env'. That would let us make sure that the env
vars are only used exactly where we want them.
For the Eshell side, I think this bug has shown that it's time to review
how it handles environment variables in general for remote hosts.
Another interesting bug is how we set PWD and OLDPWD to Tramp filenames
on remote hosts. When running an external process on that host, we
should probably use the local file name instead, since non-Emacs
programs won't understand our remote file syntax.
I'm sure there are other bugs besides that too. Maybe the default
behavior for env vars is that they should be connection-local (so remote
hosts don't see your env vars), and then we can opt into passing certain
special vars (like TERM) to all remote hosts. I'll think about this some
more and file a bug when I have something more concrete.
prev parent reply other threads:[~2023-08-28 18:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-26 14:11 bug#65551: 29.1; Eshell on MS-Windows using plink: 'plink' is not recognized as an internal or external command Jordan Wilson
2023-08-26 14:42 ` Eli Zaretskii
2023-08-26 14:48 ` Jordan Wilson
2023-08-26 15:12 ` Eli Zaretskii
2023-08-26 19:16 ` Jim Porter
2023-08-26 21:28 ` Jordan Wilson
2023-08-27 6:30 ` Jim Porter
2023-08-27 17:55 ` Michael Albinus
2023-08-27 17:50 ` Michael Albinus
2023-08-27 18:48 ` Jim Porter
2023-08-28 10:27 ` Michael Albinus
2023-08-28 16:29 ` Jim Porter
2023-08-28 16:47 ` Jim Porter
2023-08-28 16:53 ` Jim Porter
2023-08-28 17:40 ` Michael Albinus
2023-09-08 1:18 ` Jim Porter
2023-08-28 17:33 ` Michael Albinus
2023-08-28 18:01 ` Jim Porter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0dcc88be-6326-f1d8-9dbc-e2bce7b8fc64@gmail.com \
--to=jporterbugs@gmail.com \
--cc=65551@debbugs.gnu.org \
--cc=jordan.t.wilson@gmx.com \
--cc=michael.albinus@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).