Subject: bug#76551: 31.0.50; Missing space in minibuffer `sudo' password

From: Visuwesh <[email-masked]>
Date: Wed, 26 Feb 2025 18:53:22 +0530

[புதன் பிப்ரவரி 26, 2025] Eli Zaretskii wrote:

>> From: Rudolf Adamkovič <[email-masked]>
>> Date: Tue, 25 Feb 2025 14:43:02 +0100
>> 
>> 
>> DESCRIPTION:
>> 
>>   In Emacs,
>> 
>>     minibuffer prompts are always suffixed with the space character,
>> 
>>   for example:
>>   
>>     Find file: ~/...
>>               |
>>               +------------ space
>>   
>>   but this is not the case with `sudo':
>>   
>>     Password:******
>>              |
>>              +------------- missing space
>> 
>> REPRODUCTION STEPS:
>> 
>>   1. Launch `emacs -Q'.
>>   2. Evaluate the following sexp:
>>   
>>      (let ((buffer-name "*testing*"))
>>        (let ((compilation-buffer-name-function (lambda (mode) buffer-name)))
>>          (compile "sudo echo 1" t)))
>> 
>> EXPECTED RESULT:
>> 
>>   Emacs prompts the user in the minibuffer with "Password: ".
>> 
>> ACTUAL RESULT:
>> 
>>   Emacs prompts the user in the minibuffer with "Password:".
>
> Does this prompt come from Emacs or from 'sudo'?  If from Emacs, can
> you tell where is the prompt produced?

The prompt is from `sudo'.  comint-watch-for-password-prompt, which is
in comint-output-filter-functions, turns the password prompt in
*testing* buffer to read-passwd call.

But I cannot reproduce it here since sudo's prompt is different here:

sudo echo 1
[sudo] password for viz: 

where there's a space after "viz:".