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: Siyuan Chen <chansey97 <at> gmail.com>
To: 74550 <at> debbugs.gnu.org
Subject: bug#74550: eshell cannot set the environment variable PATH on Windows
Date: Wed, 27 Nov 2024 04:38:30 +0800
[Message part 1 (text/plain, inline)]
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.

P.S. I have also tried `eshell-set-path` and `with-environment-variables`,
but they cannot set PATH as well. For example,

(require 'eshell)

(defun eshell2()
  (interactive)
  (eshell-set-path '("C:/env"))
  (call-interactively 'eshell))

(defun eshell3()
  (interactive)
  (with-environment-variables (("PATH" (concat "C:/env" path-separator
(getenv "PATH"))))
    (call-interactively 'eshell)))

Emacs 29.4 on Windows 10.

Thanks.

Best regards,
Siyuan Chen
[Message part 2 (text/html, inline)]

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.