crazy shit.

This commit is contained in:
didier committed 2024-08-09 09:55:52 -04:00
1 parent d57a00bbc8
commit 7bf9a0398f
356 files changed
+196503 -3

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
// +build !appengine,!js,windows
package logrus
import (
"io"
"os"
"golang.org/x/sys/windows"
)
func checkIfTerminal(w io.Writer) bool {
switch v := w.(type) {
case *os.File:
handle := windows.Handle(v.Fd())
var mode uint32
if err := windows.GetConsoleMode(handle, &mode); err != nil {
return false
}
mode |= windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING
if err := windows.SetConsoleMode(handle, mode); err != nil {
return false
}
return true
}
return false
}