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


Message #14 received at 74550 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Siyuan Chen <chansey97 <at> gmail.com>
Cc: 74550 <at> debbugs.gnu.org
Subject: Re: bug#74550: eshell cannot set the environment variable PATH on
 Windows
Date: Wed, 27 Nov 2024 10:52:47 -0800
On 11/27/2024 9:15 AM, Siyuan Chen wrote:
> It works, thanks.
> 
> However, this seems to be a global setting only. Is there any equivalent 
> of with-environment-variables for exec-path?

Not exactly. However, you can use setq-local or eshell/addpath:

  (defun shell1 ()
    (interactive)
    (let ((current-prefix-arg 4))
      (call-interactively 'shell)
      (setq-local exec-path (cons "C:/foo" exec-path))
      ;; or ...
      (eshell/addpath "-b" "C:/foo")))

That's probably the best way to do it for now. I think it's probably 
reasonable for Eshell to work correctly when you've let-bound 
'exec-path' like in your examples, but I'll have to think about the best 
way to do it.




This bug report was last modified 206 days ago.

Previous Next


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