Disable global styles #1673
-
Is there any option to globally disable styles for Currently, the only way I know is: If isColorsEnabled Then
AnsiConsole.MarkupLine("[bold red on black]Hello, world!![/]")
Else
Console.WriteLine("Hello, world!")
End If That's two different strings, and I have to change across multiple files that uses |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you only want the colors disabled, spectre.console supports NO_COLOR. Simply setting an env variable If you need a bit more control, you can change the profile of For example, like this: // remove all colors from the output
AnsiConsole.Console.Profile.Capabilities.ColorSystem = ColorSystem.NoColors;
// remove all ANSI sequences
AnsiConsole.Console.Profile.Capabilities.Ansi = false; |
Beta Was this translation helpful? Give feedback.
If you only want the colors disabled, spectre.console supports NO_COLOR. Simply setting an env variable
NO_COLOR=1
should remove all colors from the output.If you need a bit more control, you can change the profile of
AnsiConsole
- you could do that once and all output will be changed.For example, like this: