GNU bug report logs - #20008
24.4; Eshell eshell/which uses eshell-path-env but error with (getenv "PATH"), and these 2 sometimes get out of sync (not remote directory)

Previous Next

Package: emacs;

Reported by: Hua Wei <phuck163 <at> 163.com>

Date: Thu, 5 Mar 2015 16:52:01 UTC

Severity: minor

Tags: confirmed

Found in versions 24.4, 27.0.50

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Kangas <stefan <at> marxist.se>
To: Hua Wei <phuck163 <at> 163.com>
Cc: 20008 <at> debbugs.gnu.org
Subject: bug#20008: 24.4; Eshell eshell/which uses eshell-path-env but error with (getenv "PATH"), and these 2 sometimes get out of sync (not remote directory)
Date: Sun, 01 Dec 2019 09:07:21 +0100
found 20008 27.0.50
tags 20008 + confirmed
thanks

Hua Wei <phuck163 <at> 163.com> writes:

> M-x eshell
> switch to other buffer 
> use (setenv "PATH"  "some path") to set new PATH env var
> enter eshell with C-u 2 eshell   (there is already one eshell buffer running)
>   a new eshell buffer opens
> type command "which <new cmd under new path>"
> output   "not found   in 'path'"  (in this message, the 'path' is from (getenv "PATH"))
>   this is confusing, because the function uses 'eshell-path-env' for search and use (getenv "PATH") for error messaging 
> the bug:
> eshell-path-env gets out of sync with (getenv "PATH")

I can reproduce this bug on Emacs 27.1 using the following recipe:

0. emacs -Q
1. M-x eshell
2. Enter commands in eshell:

   mkdir /tmp/foobin
   cp /bin/true /tmp/foobin/foobar
   setenv PATH /tmp/foobin
   foobar

Here is a transcript:

    Welcome to the Emacs shell
    
    ~ $ mkdir /tmp/foobin
    ~ $ cp /bin/true /tmp/foobin/foobar
    ~ $ setenv PATH /tmp/foobin
    /tmp/foobin
    ~ $ foobar
    foobar: command not found

Best regards,
Stefan Kangas




This bug report was last modified 2 years and 269 days ago.

Previous Next


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