func terminalSize(out *os.File) (int, int, error) {
	ws, err := unix.IoctlGetWinsize(int(out.Fd()), unix.TIOCGWINSZ)
	if err != nil {
		return 0, 0, err
	}
	return int(ws.Col), int(ws.Row), nil
}
terminalSize retrieves the cols/rows for the terminal connected to out.
package prompt
import (
	"os"
	"golang.org/x/sys/unix"
)
const (
	tcgets  = unix.TCGETS
	tcsetsf = unix.TCSETSF
	tcsets  = unix.TCSETS
)