2024-07-19 13:48:01 +00:00
|
|
|
//go:build windows
|
2022-05-28 13:07:28 +00:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import "golang.org/x/sys/windows"
|
|
|
|
|
|
|
|
func init() {
|
2022-07-13 19:11:06 +00:00
|
|
|
// vt output (escape codes)
|
|
|
|
var outMode uint32
|
|
|
|
windows.GetConsoleMode(windows.Stdout, &outMode)
|
|
|
|
windows.SetConsoleMode(windows.Stdout, outMode | windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING)
|
|
|
|
|
|
|
|
// vt input
|
|
|
|
var inMode uint32
|
|
|
|
windows.GetConsoleMode(windows.Stdin, &inMode)
|
|
|
|
windows.SetConsoleMode(windows.Stdin, inMode | windows.ENABLE_VIRTUAL_TERMINAL_INPUT)
|
2022-05-28 13:07:28 +00:00
|
|
|
}
|