File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ public static class VirtualConsole
2121 public static string FileOutputPath = null ;
2222
2323 static bool IsAttached = false ;
24+ static bool IsOutputPiped = false ;
2425 public static bool IsSilent = false ;
2526
2627 static VirtualConsole ( )
@@ -29,6 +30,8 @@ static VirtualConsole()
2930 ( ( VirtualTextWriter ) Out ) . Written += OutWritten ;
3031 ( ( VirtualTextWriter ) Error ) . LineWritten += ErrorLineWritten ;
3132 ( ( VirtualTextWriter ) Error ) . Written += ErrorWritten ;
33+
34+ IsOutputPiped = Console . IsOutputRedirected ;
3235
3336 SystemOut = Console . Out ;
3437 SystemError = Console . Error ;
@@ -72,7 +75,7 @@ public static void ClearLastLine()
7275
7376 if ( IsAttached && ! IsSilent )
7477 {
75- if ( Console . WindowWidth > 1 )
78+ if ( ! IsOutputPiped && Console . WindowWidth > 1 )
7679 {
7780 int currentLineCursor = Console . CursorTop ;
7881 Console . SetCursorPosition ( 0 , Console . CursorTop ) ;
You can’t perform that action at this time.
0 commit comments