Files
bantam/term_other.go
T

32 lines
687 B
Go
Raw Normal View History

2026-08-15 08:27:24 +03:00
//go:build !linux && !darwin && !dragonfly && !freebsd && !netbsd && !openbsd && !windows
2026-08-08 23:10:10 +03:00
package main
2026-08-18 10:17:52 +03:00
import (
"fmt"
"os"
"os/exec"
"strconv"
"strings"
)
2026-08-08 23:10:10 +03:00
2026-08-18 10:17:52 +03:00
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
}
2026-08-08 23:10:10 +03:00
func isTerminal(fd int) bool { return false }
func makeRaw(fd int) (func(), error) {
return nil, fmt.Errorf("raw terminal not supported on this platform")
}