// GetSize returns the current size of the user's terminal. If it isn't a terminal, // nil is returned. func (t TTY) GetSize() *remotecommand.TerminalSize { … } // GetSize returns the current size of the terminal associated with fd. func GetSize(fd uintptr) *remotecommand.TerminalSize { … } // MonitorSize monitors the terminal's size. It returns a TerminalSizeQueue primed with // initialSizes, or nil if there's no TTY present. func (t *TTY) MonitorSize(initialSizes ...*remotecommand.TerminalSize) remotecommand.TerminalSizeQueue { … } type sizeQueue … var _ … // monitorSize primes resizeChan with initialSizes and then monitors for resize events. With each // new event, it sends the current terminal size to resizeChan. func (s *sizeQueue) monitorSize(outFd uintptr, initialSizes ...*remotecommand.TerminalSize) { … } // Next returns the new terminal size after the terminal has been resized. It returns nil when // monitoring has been stopped. func (s *sizeQueue) Next() *remotecommand.TerminalSize { … } // stop stops the background goroutine that is monitoring for terminal resizes. func (s *sizeQueue) stop() { … }