GNU bug report logs - #60722
30.0.50; [PATCH] Using Tramp to sudo in Eshell doesn't change prompt sigil

Previous Next

Package: emacs;

Reported by: Jim Porter <jporterbugs <at> gmail.com>

Date: Tue, 10 Jan 2023 23:51:02 UTC

Severity: normal

Tags: patch

Found in version 30.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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#60722: closed (30.0.50; [PATCH] Using Tramp to sudo in Eshell
 doesn't change prompt sigil)
Date: Tue, 17 Jan 2023 01:22:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 16 Jan 2023 17:21:04 -0800
with message-id <9075c231-e0b7-d4bb-2655-3eed020e3cdf <at> gmail.com>
and subject line Re: bug#60722: 30.0.50; [PATCH] Using Tramp to sudo in Eshell doesn't change prompt sigil
has caused the debbugs.gnu.org bug report #60722,
regarding 30.0.50; [PATCH] Using Tramp to sudo in Eshell doesn't change prompt sigil
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
60722: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60722
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jim Porter <jporterbugs <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; [PATCH] Using Tramp to sudo in Eshell doesn't change prompt
 sigil
Date: Tue, 10 Jan 2023 15:50:03 -0800
[Message part 3 (text/plain, inline)]
X-Debbugs-Cc: michael.albinus <at> gmx.de

Starting with "sudo emacs -Q -f eshell", notice that the prompt looks like:

  /home/user #

Now start "emacs -Q -f eshell":

  ~ $ cd /sudo::
  /sudo:root <at> huginn:~ $

Notice that the prompt sigil is still "$" instead of "#". I think it 
would be better to indicate that you have a root shell by using "#" here.

Attached is a patch to do this. It adds a new function, 
'user-uid-for-file', which is aware of file name handlers. Then, Tramp 
adds the appropriate handler. Now, Eshell can use that function and we 
get the prompt sigil we expect.
[0001-Add-user-uid-for-file-to-get-the-effective-UID-for-r.patch (text/plain, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Jim Porter <jporterbugs <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 60722-done <at> debbugs.gnu.org
Subject: Re: bug#60722: 30.0.50; [PATCH] Using Tramp to sudo in Eshell doesn't
 change prompt sigil
Date: Mon, 16 Jan 2023 17:21:04 -0800
On 1/16/2023 1:09 AM, Michael Albinus wrote:
>> diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
>>
>> +@defun file-user-uid
>> +This function returns the connection-local for the user's effective
> 
> "connection-local value"

Thanks, fixed.
> 
>> diff --git a/etc/NEWS b/etc/NEWS
>>
>> +** New function 'file-user-uid'.
>> +This function is like 'user-uid', but is aware of file name handlers,
>> +so it will return the remote UID for remote files.
> 
> Perhaps you could also mention -1 as the "don't know" result.

Also fixed.

I've now merged this to the master branch as 0bb8a011d5. Closing this 
bug, though we can obviously discuss further (here or elsewhere) if 
there's any fallout from the change.


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

Previous Next


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