dotnet-counters: Disable ANSI support on Windows as VTerm doesn't always respect...
authormikelle-rogers <45022607+mikelle-rogers@users.noreply.github.com>
Mon, 4 Apr 2022 02:20:48 +0000 (20:20 -0600)
committerGitHub <noreply@github.com>
Mon, 4 Apr 2022 02:20:48 +0000 (19:20 -0700)
src/Tools/dotnet-counters/CounterMonitor.cs

index 5e5d7943118b047a5735c54faed8e331e4d46651..b1790fda668ad93f87656722545f5a3c01e13c9a 100644 (file)
@@ -20,6 +20,7 @@ using System.Linq;
 using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
+using System.Runtime.InteropServices;
 
 namespace Microsoft.Diagnostics.Tools.Counters
 {
@@ -475,7 +476,7 @@ namespace Microsoft.Diagnostics.Tools.Counters
                 using (DiagnosticsClientHolder holder = await builder.Build(ct, _processId, diagnosticPort, showChildIO: false, printLaunchCommand: false))
                 using (VirtualTerminalMode vTerm = VirtualTerminalMode.TryEnable())
                 {
-                    bool useAnsi = vTerm.IsEnabled;
+                    bool useAnsi = vTerm.IsEnabled && !RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
                     if (holder == null)
                     {
                         return ReturnCode.Ok;