-
Notifications
You must be signed in to change notification settings - Fork 510
Any prompt for input on Linux times out. #1936
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
Comments
Since it looks like PSReadLine is enabled by default now, I suppose it's unlikely anyone would end up in this situation, unless they have an older settings file they end up moving to a Linux machine. It could still be nice to protect against this if anyone does end up in this scenario. It had been frustrating me for quite some time before I got around to diagnosing. Looks like it could be fixed by filtering the featureFlags out based on the OS here: vscode-powershell/src/process.ts Lines 52 to 56 in f9e13c6
|
Hi @jclay, thanks for opening an issue. This is a known issue that we've been working toward fixing. I thought there would be an existing issue, but can't find one. The problem occurs because PSReadLine must cancel the prompt in order to process messages from the extension. On Windows there is a solution to this problem, but on *nix the API does not exist. Essentially it's a difficult issue with no easy fix. We chose to allow the usage of PSReadLine in *nix, but not have it turned on by default, as opposed to on Windows where PSReadLine is turned on by default. This is so it's still possible to opt-in to PSReadLine, but must be explicitly configured. As I say, we're working toward a solution. |
This is fixed if you use the preview version of PowerShell 7! |
We will be waiting to release the "preview" extension as "stable" until after 7 GA so I'm going to close this as there's no work on the extension side needed. The recommendation is to use PowerShell 7. 6.2 will be EOL 6 months after 7's release anyway. For 6.2, we fallback to the legacy readline so at least the experience in the extension isn't broken, just not as nice as PowerShell 7's. |
System Details
System Details Output
Issue Description
When running commands on Linux which are prefixed with sudo, the Powershell Integrated Console will timeout the prompt before there is chance to enter characters.
Expected Behaviour
The prompt should wait (indefinitely?) for the user to enter characters. This works as expected in any other terminal (even if I create an VSCode terminal which starts bash, then enter pwsh).
Actual Behaviour
As you can see below (the same happens for any command prefixed with sudo). If i don't type any characters, this times out in just over a second.
How to Resolve
I was able to diagnose this myself in the end, but wanted to make a note for anyone else who may experience this.
I share my
settings.json
between Windows and Linux, and I had the following setting turned on to use PSReadline (for Windows):Disabling this setting and reloading seems to completely resolve the issue.
The text was updated successfully, but these errors were encountered: