From 759aff1cf139cdc3433e6715b2e5be7ba413e53f Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Fri, 9 Jun 2017 14:57:53 -0700 Subject: [PATCH] Make ConsoleHost honor NoEcho on Unix platforms (#3801) --- .../host/msh/ConsoleHostRawUserInterface.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs index e90f132094..16cb2fd42d 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs @@ -1745,10 +1745,10 @@ namespace Microsoft.PowerShell /// from the keyboard device, blocking processing until a keystroke is /// typed that matches the specified keystroke options. /// - /// Unused + /// Only NoEcho is supported. 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); }