File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/BuiltInTools/HotReloadAgent.Host Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ internal sealed class StartupHook
2222{
2323 private static readonly string ? s_standardOutputLogPrefix = Environment . GetEnvironmentVariable ( AgentEnvironmentVariables . HotReloadDeltaClientLogMessages ) ;
2424 private static readonly string ? s_namedPipeName = Environment . GetEnvironmentVariable ( AgentEnvironmentVariables . DotNetWatchHotReloadNamedPipeName ) ;
25+ private static readonly bool s_supportsConsoleColor = ! OperatingSystem . IsAndroid ( )
26+ && ! OperatingSystem . IsIOS ( )
27+ && ! OperatingSystem . IsTvOS ( )
28+ && ! OperatingSystem . IsBrowser ( ) ;
2529
2630#if NET10_0_OR_GREATER
2731 private static PosixSignalRegistration ? s_signalRegistration ;
@@ -160,9 +164,17 @@ private static void Log(string message)
160164 var prefix = s_standardOutputLogPrefix ;
161165 if ( ! string . IsNullOrEmpty ( prefix ) )
162166 {
163- Console . ForegroundColor = ConsoleColor . DarkGray ;
167+ if ( s_supportsConsoleColor )
168+ {
169+ Console . ForegroundColor = ConsoleColor . DarkGray ;
170+ }
171+
164172 Console . Error . WriteLine ( $ "{ prefix } { message } ") ;
165- Console . ResetColor ( ) ;
173+
174+ if ( s_supportsConsoleColor )
175+ {
176+ Console . ResetColor ( ) ;
177+ }
166178 }
167179 }
168180}
You can’t perform that action at this time.
0 commit comments