Simplify checkIfTerminal for Windows

Instead of relying on EnableVirtualTerminalProcessing from
github.com/konsorten/go-windows-terminal-sequences which just calls
GetConsoleMode, sets ENABLE_VIRTUAL_TERMINAL_PROCESSING and calls
SetConsoleMode with the new modified mode, implement it directly inside
checkIfTerminal. This also avoids the duplicate call to GetConsoleMode.
This commit is contained in:
Tobias Klauser
2020-01-12 01:49:45 +01:00
parent 60c74ad9be
commit 86657918d4
4 changed files with 12 additions and 24 deletions
+1 -1
View File
@@ -18,5 +18,5 @@ fi
if [[ "$GO111MODULE" == "off" ]]; then
# Should contain all regular (not indirect) modules from go.mod
go get github.com/stretchr/testify golang.org/x/sys/unix github.com/konsorten/go-windows-terminal-sequences
go get github.com/stretchr/testify golang.org/x/sys/unix golang.org/x/sys/windows
fi