Subject: bug#75746: 31.0.50; Can't get password promote from plink 0.82

From: Eli Zaretskii <[email-masked]>
Date: Thu, 30 Jan 2025 17:25:55 +0200

> Cc: "[email-masked]" <[email-masked]>,
>  Shuguang Sun <[email-masked]>
> Date: Thu, 30 Jan 2025 13:55:45 +0100
> From:  Michael Albinus via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> "孙曙光(Sun Shuguang)" <[email-masked]> writes:
> 
> Hi Shuguang,
> 
> >> Thanks, this looks proper. Could you please call Emacs like "emacs -Q --eval
> >> '(setq tramp-verbose 10)'"? Try to connect via plink. If it hangs or runs into
> >> the timeout, send the resulting Tramp debug buffer "*debug tramp/plink
> >> 192.168.x.x*" or "*debug tramp/plink [email-masked]*".
> >
> > Please find the attachment. I have deleted some repeated part to reduce the file size.
> 
> Hmm. I've installed PuTTY 0.82 on my Windows 11 VM, running Emacs
> 29.4. The same problem happens.
> 
> I have no idea (yet), how to solve it, although I've played with
> different changes the last hours.
> 
> What looks suspicious are the PuTTY Release Notes
> <https://www.chiark.greenend.org.uk/~sgtatham/putty/changes.html>:
> 
> --8<---------------cut here---------------start------------->8---
>  These features are new in 0.82 (released 2024-11-27):
> 
>     Major refactoring of Unicode handling to allow the use of 'foreign' Unicode characters, i.e. outside the system's configured default character set / code page. Not yet complete, but the following things work:
>         Windows console: usernames and passwords entered interactively into PSCP, PSFTP and Plink can use foreign characters.
>         Windows command line: usernames, remote commands, and filenames entered via command-line options can use foreign characters.
>         PuTTY's own terminal (on Windows and Unix): even if it's not configured into UTF-8 mode for the main session, interactive usernames and passwords can use foreign characters. 
>     Unicode version update: all character analysis is updated to Unicode 16.0.0.
>     Unicode terminal rendering: national and regional flags are now understood by PuTTY's terminal emulator. (However, correct display of those flags will depend on fonts and operating system.)
>     The Event Log mentions the local address and port number of the outgoing connection socket.
>     Bracketed paste mode can now be turned off in the Terminal > Features panel.
>     Unix Pageant: new --foreground mode for running as a subprocess.
>     Bug fix: the 'border width' configuration option is now honoured even when the window is maximised.
>     Bug fix: SHA-2 based RSA signatures are now sent with correct zero padding.
>     Bug fix: terminal wrap mishandling caused occasional incorrect redraws in curses-based applications.
>     Bug fix: Alt + function key in "Xterm 216+" mode sent a spurious extra escape character. 
> --8<---------------cut here---------------end--------------->8---
> 
> I suspect this is related to the changed behaviour. I have no idea, what
> I shall do in Tramp.

Does the user name or password include non-ASCII characters?
Does Tramp assume something about the encoding of stuff sent to plink
and received from plink?