0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-12 07:23:13 +01:00
gitea/vendor/github.com/jessevdk/go-flags/termsize.go

16 lines
235 B
Go
Raw Normal View History

// +build !windows,!plan9,!appengine,!wasm
package flags
import (
"golang.org/x/sys/unix"
)
func getTerminalColumns() int {
ws, err := unix.IoctlGetWinsize(0, unix.TIOCGWINSZ)
if err != nil {
return 80
}
return int(ws.Col)
}