New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"external OpenSSH" configuration causes "Pseudo-terminal will not be allocated because stdin is not a terminal" in Git Bash #4704
Comments
This is mentioned in the Known Issues in our Release Notes:
And indeed it works with $ winpty /c/Windows/system32/OpenSSH/ssh git@github.com
git@github.com: Permission denied (publickey). Another approach has to do with this:
You could turn on support for Pseudo Terminals: $ MSYS=disable_pcon /c/Windows/system32/OpenSSH/ssh git@github.com
Pseudo-terminal will not be allocated because stdin is not a terminal.
git@github.com: Permission denied (publickey).
$ MSYS=enable_pcon /c/Windows/system32/OpenSSH/ssh git@github.com
git@github.com: Permission denied (publickey). The installer even suggests (on the page titled "Configuring the terminal emulator to use with Git Bash") to
|
I'd argue that the average user doesn't read all the descriptions in the installer, and maybe doesn't even have the background knowledge to understand them. If there's a default value and I don't see any immediate reason to change it, I'll just accept it. Just from the "Pseudo-terminal will not [...]" message, I wasn't able to find any of the documentation/hints/workarounds you linked. In any case, I think it would be desirable that the default installation works nicely, even if I choose to use Windows' SSH client. Is there a change we could enable pseudo console support by default? MSYS2 has ConPTY support enabled by default since 2022-09, this seems to be what setting Alternatively, I think it is by now feasible to default to Windows' console window instead of MinTTY. This is related to #3689. Here, backwards compatibility with Windows Vista was given as a reason not to do this. However, all Windows versions <= 8.1 are at their end of life and don't get security updates anymore, so I think it's fair to update defaults for easier usability for modern systems. (Edit: Note: MSYS2 dropped support for Windows <=8.0 in 2023-01) |
We can only show them the information, but we can't force them to understand it.
It's not default then anymore, is it? But I guess it would make sense to add some hints like "You've enabled Feature X, it is recommended to also enable Feature Y".
Old builds of Windows 10 and Windows Versions going back to Windows Vista to be precise. And all of them except Vista are still supported. We're currently still supporting Windows 7 and 8.0 until we switch to a Cygwin 3.5.x based msys2-runtime and even then we have no current plans to discontinue Windows 8.1 support. I still stand by what I wrote back then:
We could default to conhost and conpty on Windows 10, version 1809 and newer, if we deem it stable enough. I'm not the right person to judge if it is stable enough though.
[citation needed] Our bundled OpenSSH is usually more modern than system OpenSSH and usability with that is pretty good, even without ConPTY. |
Judging from my experience, ConPTY support has become slightly more robust, and since it was done (unfortunately) in a way that made the |
Setup
I installed Git-2.43.0-64-bit.exe on Windows 10 Pro (64-bit) and selected "Use external OpenSSH" when prompted.
The "external OpenSSH" installation is the one provided by windows by default:
Details
Inside Git Bash, when I try to connect to some SSH server, the SSH client prints:
As a MCVE, you can try to connect to github.com:
I'm running an interactive shell session in Git Bash, and so I'd expect SSH to correctly determine this and allocate a pseudo-terminal.
For any SSH server that actually allows an interactive shell session (github.com does not allow this), you will be greeted by the message of the day, but the shell running will not be started in interactive mode. As a consequence, it will seem like the connection hangs, as no prompt will be printed. Ctrl+C will terminate the connection.
As a workaround, you can pass
-tt
to ssh to force tty allocation. This will get you a prompt. However, the SSH session still behaves weirdly, e.g.This may be a different bug though.
In Windows PowerShell and the Windows Command Prompt, the ssh client behaves as expected.
An example of a "broken" shell session:
The text was updated successfully, but these errors were encountered: