Enable pre and post write in WriteToConsole
This commit is contained in:
parent
800fa4ca18
commit
fa86c89925
1 changed files with 6 additions and 3 deletions
|
@ -552,9 +552,8 @@ namespace Microsoft.PowerShell
|
|||
|
||||
internal void WriteToConsole(string value, bool transcribeResult)
|
||||
{
|
||||
#if OPEN
|
||||
Console.Out.Write(value);
|
||||
#else
|
||||
|
||||
#if !OPEN
|
||||
ConsoleHandle handle = ConsoleControl.GetActiveScreenBufferHandle();
|
||||
|
||||
// Ensure that we're in the proper line-output mode. We don't lock here as it does not matter if we
|
||||
|
@ -571,12 +570,16 @@ namespace Microsoft.PowerShell
|
|||
m |= desiredMode;
|
||||
ConsoleControl.SetMode(handle, m);
|
||||
}
|
||||
#endif
|
||||
|
||||
PreWrite();
|
||||
|
||||
// This is atomic, so we don't lock here...
|
||||
|
||||
#if !OPEN
|
||||
ConsoleControl.WriteConsole(handle, value);
|
||||
#else
|
||||
Console.Out.Write(value);
|
||||
#endif
|
||||
|
||||
if (isInteractiveTestToolListening && Console.IsOutputRedirected)
|
||||
|
|
Loading…
Reference in a new issue