Files
bd2/go/internal/server/logging/terminal_windows.go
T
Flechazo d04791dd31 feat(server): add colored logs, level rewards, hunting dispatch and fiend hunt
Persist claims, AP, teams and presets with session receipts and atomic request rollback. Read rewards and growth from GameData; replace fixed Fiend Hunt user state and preserve the account initialization contract.
2026-10-04 21:27:19 +08:00

18 lines
352 B
Go

//go:build windows
package logging
import (
"golang.org/x/sys/windows"
"os"
)
func terminalSupportsColor(file *os.File) bool {
handle := windows.Handle(file.Fd())
var mode uint32
if windows.GetConsoleMode(handle, &mode) != nil {
return false
}
return windows.SetConsoleMode(handle, mode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING) == nil
}