GNU bug report logs - #74146
ESHELL prompt shows incorrect working directory on a TRAMP remote host

Previous Next

Package: emacs;

Reported by: dnym <at> duck.com

Date: Thu, 31 Oct 2024 21:40:01 UTC

Severity: normal

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: Jim Porter <jporterbugs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 74146 <at> debbugs.gnu.org, dnym <at> duck.com
Subject: bug#74146: ESHELL prompt shows incorrect working directory on a TRAMP remote host
Date: Thu, 7 Nov 2024 13:58:43 -0800
On 11/1/2024 12:27 AM, Eli Zaretskii wrote:
>> Date: Thu, 31 Oct 2024 17:39:48 -0700
>> From: Jim Porter <jporterbugs <at> gmail.com>
>>
>> Thanks for the report. This is an MS-Windows only issue, fixed in
>> 33997047e891d5513c4f33ab78ad353746ed16e2 on Emacs master (so version 31).
>>
>> In the meantime though, you can customize 'eshell-pwd-convert-function'
>> to avoid this mis-conversion; the 'identity' option should work. (I'm
>> not actually sure why this has a different default value on MS-Windows
>> vs other paltforms, but it's been that way for a long time so I'll just
>> about opening that can of worms for now...)
> 
> I'm guessing that the difference is because we want to convert any
> backslashes into forward slashes, and also make the drive letter
> explicit if needed.  Perhaps it is worth our while to add a comment to
> this effect there.

Yeah, looking into this some more, I think it's for making the drive 
letter explicit. However, I also think we actually want to use 
'expand-file-name' on *all* systems, not just MS-Windows.

On GNU/Linux, if I'm in a subdirectory of $HOME, the Eshell 
implementation of "pwd" will print "~/some/directory", but the external 
"/usr/bin/pwd" will print "/home/jim/some/directory". Since the Eshell 
built-in commands are supposed to be like their external counterparts, I 
think we want to expand the value of 'default-directory' all the time.

I've therefore made this change on the master branch so that "pwd" in 
Eshell behaves as expected, and added a NEWS entry to inform users in 
case they want to revert to the old behavior.




This bug report was last modified 193 days ago.

Previous Next


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