We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d080a5b commit 8eb2f66Copy full SHA for 8eb2f66
1 file changed
color_windows.go
@@ -11,8 +11,10 @@ func init() {
11
// https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#output-sequences
12
var outMode uint32
13
out := windows.Handle(os.Stdout.Fd())
14
- if err := windows.GetConsoleMode(out, &outMode); err == nil {
15
- outMode |= windows.ENABLE_PROCESSED_OUTPUT | windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING
16
- _ = windows.SetConsoleMode(out, outMode)
+ if err := windows.GetConsoleMode(out, &outMode); err == nil || NoColor {
+ return
17
}
+
18
+ outMode |= windows.ENABLE_PROCESSED_OUTPUT | windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING
19
+ _ = windows.SetConsoleMode(out, outMode)
20
0 commit comments