blob: 829e477addfb5f915d12a48290019f0ea8a12391 [file] [log] [blame]
Naveen Sampath04696f72022-06-13 15:19:14 +05301// +build !windows,!plan9,!appengine,!wasm
2
3package flags
4
5import (
6 "golang.org/x/sys/unix"
7)
8
9func getTerminalColumns() int {
10 ws, err := unix.IoctlGetWinsize(0, unix.TIOCGWINSZ)
11 if err != nil {
12 return 80
13 }
14 return int(ws.Col)
15}