fix: broken ansi escape codes on windows cmd

userdata
TorchedSammy 2022-05-28 09:07:28 -04:00
parent 9d385efbfc
commit e3c25586e4
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 11 additions and 0 deletions

11
init_windows.go 100644
View File

@ -0,0 +1,11 @@
// +build windows
package main
import "golang.org/x/sys/windows"
func init() {
var mode uint32
windows.GetConsoleMode(windows.Stdout, &mode)
windows.SetConsoleMode(windows.Stdout, mode | windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING)
}