Files
bantam/term_windows.go
T
2026-08-18 10:17:52 +03:00

30 lines
611 B
Go

//go:build windows
package main
import (
"errors"
"os"
"os/exec"
"strconv"
"strings"
)
func termWidth() int {
if w := os.Getenv("COLUMNS"); w != "" {
if n, err := strconv.Atoi(strings.TrimSpace(w)); err == nil && n > 0 {
return n
}
}
if out, err := exec.Command("tput", "cols").Output(); err == nil {
if n, err := strconv.Atoi(strings.TrimSpace(string(out))); err == nil && n > 0 {
return n
}
}
return 80
}
func isTerminal(fd int) bool { return false }
func makeRaw(fd int) (func(), error) { return nil, errors.New("raw terminal not supported on windows") }