From e3c25586e42f770f85401440cb32cc6752fdfd39 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Sat, 28 May 2022 09:07:28 -0400 Subject: [PATCH] fix: broken ansi escape codes on windows cmd --- init_windows.go | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 init_windows.go diff --git a/init_windows.go b/init_windows.go new file mode 100644 index 0000000..ee17a6b --- /dev/null +++ b/init_windows.go @@ -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) +}