mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Enable pre and post write in WriteToConsole
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user