mirror of
https://codeberg.org/superseriousbusiness/gotosocial.git
synced 2024-12-23 09:30:22 +03:00
16 lines
235 B
Go
16 lines
235 B
Go
|
// +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)
|
||
|
}
|