func getTermios(fd uintptr) (*unix.Termios, error) {
	termios := new(unix.Termios)
	_, _, err := unix.Syscall(unix.SYS_IOCTL, fd, tcgets,
		uintptr(unsafe.Pointer(termios)))
	if err != 0 {
		return nil, err
	}
	return termios, nil
}
getTermios retrieves the termios settings for the terminal descriptor.
package prompt
import (
	"os"
	"unsafe"
	"golang.org/x/sys/unix"
)
type winsize struct {
	rows uint16
	cols uint16
	_    uint32
}
func terminalSize(out *os.File) (int, int, error) {
	ws := new(winsize)
	_, _, err := unix.Syscall(unix.SYS_IOCTL, out.Fd(),
		uintptr(unix.TIOCGWINSZ), uintptr(unsafe.Pointer(ws)))
	if err != 0 {
		return 0, 0, err
	}
	return int(ws.cols), int(ws.rows), nil
}