GNU bug report logs - #74550
eshell cannot set the environment variable PATH on Windows

Previous Next

Package: emacs;

Reported by: Siyuan Chen <chansey97 <at> gmail.com>

Date: Tue, 26 Nov 2024 20:39:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Jim Porter <jporterbugs <at> gmail.com>
To: Siyuan Chen <chansey97 <at> gmail.com>, 74550 <at> debbugs.gnu.org
Subject: bug#74550: eshell cannot set the environment variable PATH on Windows
Date: Tue, 26 Nov 2024 13:14:42 -0800
On 11/26/2024 12:38 PM, Siyuan Chen wrote:
> Reproduce steps:
> 
> 1. Emacs -Q
> 
> 2. M-x eval-expression `(setenv "PATH" (concat "C:/env" path-separator 
> (getenv "PATH")))`
> 
> 3. M-x eshell
> 
> 4. In the *eshell* window, type `echo $PATH`, but the path "C:/env" 
> doesn't show in the result.

Thanks for the bug report. This is an intentionally-incompatible change 
in Eshell to improve behavior with remote systems via Tramp. Here's the 
relevant section from the Emacs 29 NEWS:

> *** Eshell's PATH is now derived from 'exec-path'.
> For consistency with remote connections, Eshell now uses 'exec-path'
> to determine the execution path on the local or remote system, instead
> of using the PATH environment variable directly.

So instead, you want to do something like '(push "C:/env" exec-path)' in 
order to update the PATH in a way where Eshell sees it.





This bug report was last modified 232 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.