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

From: Michael Albinus <[email-masked]>
Date: Thu, 08 Aug 2024 13:11:16 +0200

Duncan Greatwood <[email-masked]> writes:

Hi Duncan,

> 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.
>
> Unless you have any other suggestions :-)

As said, I know nothing about MS Windows specifics. But if the shell on
the remote side would be POSIX conform, setting PS1 a fixed string
should do the job. Perhaps there's somthing on the MS Windows side like
~/.profile, where you could add such setting.

> Thanks again.

Best regards, Michael.