From 290cc2c2ded66bb99f379bb866fb9083280c76eb Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Wed, 29 Jun 2016 14:09:10 -0700 Subject: [PATCH] Implement FlushInputBuffer --- .../host/msh/ConsoleHostRawUserInterface.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs index afd050e74..1cbee3a30 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs @@ -1699,11 +1699,14 @@ namespace Microsoft.PowerShell } /// - /// This API resets the input buffer. In this example this - /// functionality is not needed so the method returns nothing. + /// This API resets the input buffer. /// public override void FlushInputBuffer() { + if (!Console.IsInputRedirected) + { + Console.OpenStandardInput().Flush(); + } } ///