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
Name Value
---- -----
PSVersion 5.1.19041.1320
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1320
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Visual Studio Code Version
1.65.2
c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1
x64
Extension Version
ms-vscode.powershell@2021.12.0
ms-vscode.powershell-preview@2022.3.0
tobysmith568.run-in-powershell@1.1.1
Steps to Reproduce
Use this code:
$AvailableEnvironments = @(
@{Choice = '&IAT'; Value = "IAT"; Help = "Test" }
@{Choice = '&Prod'; Value = "Prod"; Help = "Production" }
@{Choice = '&Dev'; Value = "Dev"; Help = "Development" }
)
$title = "Please choose the environment"
$msg = "Which environment do you want to use ?"
$Choices = foreach ($Choice in $AvailableEnvironments) {
New-Object System.Management.Automation.Host.ChoiceDescription $Choice.Choice, $Choice.Help
}
$options = $Choices
$default = 0 # 0=Yes, 1=No
$response = $Host.UI.PromptForChoice($title, $msg, $options, $default)
$MainEnvironment = $AvailableEnvironments[$response].Value
$MainEnvironment
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
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