mirror of Walter-Sparrow / lunar-tear
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 22 lines 410 B view raw
1//go:build windows 2 3package main 4 5import ( 6 "os" 7 8 "golang.org/x/sys/windows" 9 "golang.org/x/term" 10) 11 12func colorSupported() bool { 13 fd := os.Stdout.Fd() 14 if !term.IsTerminal(int(fd)) { 15 return false 16 } 17 var mode uint32 18 if windows.GetConsoleMode(windows.Handle(fd), &mode) != nil { 19 return false 20 } 21 return windows.SetConsoleMode(windows.Handle(fd), mode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING) == nil 22}