1
1
mirror of https://github.com/go-gitea/gitea synced 2024-10-31 23:34:25 +00: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)
}