mirror of https://github.com/Hilbis/Hilbish
fix: set vt in on stdin
parent
dd9aa4b6ea
commit
9902560061
|
@ -5,7 +5,13 @@ package main
|
||||||
import "golang.org/x/sys/windows"
|
import "golang.org/x/sys/windows"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
var mode uint32
|
// vt output (escape codes)
|
||||||
windows.GetConsoleMode(windows.Stdout, &mode)
|
var outMode uint32
|
||||||
windows.SetConsoleMode(windows.Stdout, mode | windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING | windows.ENABLE_VIRTUAL_TERMINAL_INPUT)
|
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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue