2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-03-31 18:53:22 +00:00

fix: set vt in on stdin

This commit is contained in:
TorchedSammy 2022-07-13 15:11:06 -04:00
parent dd9aa4b6ea
commit 9902560061
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD

View File

@ -5,7 +5,13 @@ 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 | windows.ENABLE_VIRTUAL_TERMINAL_INPUT)
// 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)
}