Documentation ¶
Overview ¶
Package tsize gets the terminal size. Supports Linux and Windows.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotATerminal = errors.New("Given file is not a terminal")
ErrNotATerminal is the error to return if the given file to FgetSize isn't a terminal.
Functions ¶
This section is empty.
Types ¶
type Size ¶
Size represents terminal size in columns and rows as Width and Height, respectively.
type SizeListener ¶
type SizeListener struct { Change <-chan Size // contains filtered or unexported fields }
SizeListener listens to terminal size changes. The new size is returned through the Change channel when the change occurs.
func NewSizeListener ¶
func NewSizeListener() (sc *SizeListener, err error)
NewSizeListener creates a new size change listener
func (*SizeListener) Close ¶
func (sc *SizeListener) Close() (err error)
Close implements the io.Closer interface that stops listening to terminal size changes.
Click to show internal directories.
Click to hide internal directories.