Make ConsoleHost honor NoEcho on Unix platforms (#3801)

This commit is contained in:
James Truher [MSFT] 2017-06-09 14:57:53 -07:00 committed by Dongbo Wang
parent 1cb2e8a1d5
commit 759aff1cf1

View file

@ -1745,10 +1745,10 @@ namespace Microsoft.PowerShell
/// from the keyboard device, blocking processing until a keystroke is
/// typed that matches the specified keystroke options.
/// </summary>
/// <param name="options">Unused</param>
/// <param name="options">Only NoEcho is supported.</param>
public override KeyInfo ReadKey(ReadKeyOptions options)
{
ConsoleKeyInfo key = Console.ReadKey();
ConsoleKeyInfo key = Console.ReadKey((options & ReadKeyOptions.NoEcho) != 0);
return new KeyInfo((int)key.Key, key.KeyChar, new ControlKeyStates(), true);
}