-
Notifications
You must be signed in to change notification settings - Fork 510
Host.ChoiceDescription need additional keypress for choosing option #3881
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
Ah ha, this one repros. Curiously enough, only when run via F5. After everything is defined, executing the script with |
public override int PromptForChoice(string caption, string message, Collection<ChoiceDescription> choices, int defaultChoice)
{
// return _consoleHostUI is not null
// ? _consoleHostUI.PromptForChoice(caption, message, choices, defaultChoice)
// : _underlyingHostUI.PromptForChoice(caption, message, choices, defaultChoice);
return _underlyingHostUI.PromptForChoice(caption, message, choices, defaultChoice);
}
That change did not resolve this, it was just difficult to repro as I wasn't quite following that it's a double-press bug. |
@MrFly72 Can you test the build I just posted in this comment: #3876 (comment)? Throw the UI through everything you can. |
@andschwa Still the same problem on F5/F8, dropping my entry and presenting it later on in the normal prompt. Choosing the Default instead of the letter pressed (which is even the worst in this) |
Ah ha...ok so this doesn't repro at all on macOS, only on Windows. As @SeeminglyScience astutely pointed out, it's due to a workaround of |
Just tested it on my Raspberry Pi 4 running VSCode and it's not failing there. So it seems really to be Windows..... |
How much of a blocker is this for you @MrFly72? Do you have a workaround available? It might prove to be quite a pain to get fixed. |
Currently it is only a blocker when using VSCode. Usually I am the only one using it for generally running my scripts. |
LOL, repeat of #1753 |
Yes, seems like a reintroduced bug ;-) |
Hi there, we just released v2022.4.0-preview! Could you please try PowerShell Preview for VS Code and verify this is fixed? It seemed to be in my testing, so marking as resolved, but please let me know if it's still occurs (or if new bugs show up)! |
This issue has been marked as fixed. It has been automatically closed for housekeeping purposes. |
Hello Andy, It is still not fixed completely. The keypress is now taken ok, but there is still some dirty keys that appear in the commandline. 2020-04-13_PS_VSCode_KeyPress.mp4 |
@MrFly72 Can I ask you what happens if, outside of the |
If I understood you right, basically pressing downarrow or a combination just in the terminal window without anything running? |
You understood correctly. You can see in PowerShell/PowerShellEditorServices#1754 that when we cancel |
Prerequisites
Summary
When using System.Management.Automation.Host.ChoiceDescription in VSCode terminal, I have to press the key two times. First keypress will not be shown. The keypress will even be delivered to the next entry line and cloak it at the front.
It works in PSextension v2021.12.0 but NOT in current preview.
PowerShell Version
Visual Studio Code Version
Extension Version
Steps to Reproduce
Use this code:
Visuals
Pressed "P" as an answer and then hit enter like expected.

Behaviour: Default value will be used instead and the "P" will end up in the input-line:
Logs
No response
The text was updated successfully, but these errors were encountered: