mirror of
https://github.com/containers/podman.git
synced 2025-10-20 12:43:58 +08:00

* If possible, update each dependency to the latest available version. * Use releases over commit IDs and avoid vendoring branches. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
19 lines
301 B
Go
19 lines
301 B
Go
// +build !windows,!plan9,!solaris
|
|
|
|
package goterm
|
|
|
|
import (
|
|
"os"
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func getWinsize() (*unix.Winsize, error) {
|
|
|
|
ws, err := unix.IoctlGetWinsize(int(os.Stdout.Fd()), unix.TIOCGWINSZ)
|
|
if err != nil {
|
|
return nil, os.NewSyscallError("GetWinsize", err)
|
|
}
|
|
|
|
return ws, nil
|
|
}
|