Subject: bug#72450: 29.1; Tramp Failed to Parse OS Name and Version for Windows 11

From: Eli Zaretskii <[email-masked]>
Date: Thu, 08 Aug 2024 08:20:44 +0300

> From: Duncan Greatwood <[email-masked]>
> Date: Wed, 7 Aug 2024 14:46:29 -0700
> Cc: Eli Zaretskii <[email-masked]>, [email-masked], [email-masked]
> 
> Re: 
> 
>  [?25l[2J[m[Hsh-5.2$[1C]0;C:\Windows\system32\conhost.exe [?25h
> 
> The actual prompt that appears on the screen is:
> sh-5.2$ 
> 
> Please note that "C:\Windows\system32\conhost.exe" is not a prompt, it is not output as text on the terminal, it
> is the "job name" that Windows provides. (FYI, conhost.exe is the core Windows process that provides any
> prompt, whether PowerShell, command prompt, or bash/sh).
> 
> As a point of comparison, when I ssh to a Linux machine the "job name" is simply ssh.
> 
> I don't know why the string emacs-tramp is seeing as the prompt appears to include the job name and those
> control characters. I have looked on client side and server side, and don't see a way of suppressing/changing
> the job name in Window's OpenSSH, nor the control characters either.
> 
> I tried it in iTerm and in Terminal. I tried it from macOS (with ssh proxy) and from Linux (no proxy). All the same
> failure.
> 
> Unless there can be different handling in respect of the job name, I don't see an approach to use ssh to
> access the windows box with tramp.

Maybe Tramp could recognize and ignore the cursor-motion parts?

Alternatively, file a bug to the MS-Windows terminal development team,
and ask them to provide at least optionally the standard behavior
exhibited by Posix platforms.