Documentation
¶
Index ¶
Constants ¶
const ( DefaultWidth = 80 DefaultHeight = 24 OPEN_ALT = "\x1b[?1049h" CLOSE_ALT = "\x1b[?1049l" HIDE_CURSOR = "\x1b[?25l" SHOW_CURSOR = "\x1b[?25h" ENABLE_MOUSE = "\x1b[?1000h\x1b[?1002h\x1b[?1006h" DISABLE_MOUSE = "\x1b[?1006l\x1b[?1002l\x1b[?1000l" ENABLE_BRACKETED_PASTE = "\x1b[?2004h" DISABLE_BRACKETED_PASTE = "\x1b[?2004l" // Ask compatible terminals to distinguish modified keys like Shift+Enter. ENABLE_KITTY_KEYBOARD = "\x1b[>1u" DISABLE_KITTY_KEYBOARD = "\x1b[<u" ENABLE_MODIFY_OTHER_KEYS = "\x1b[>4;2m" DISABLE_MODIFY_OTHER_KEYS = "\x1b[>4;0m" CLEAR_SCREEN = "\x1b[2J" MOVE_CURSOR = "\x1b[H" )
Variables ¶
var ErrNotTerminal = errors.New("stdin is not a terminal")
Functions ¶
This section is empty.
Types ¶
type Terminal ¶
type Terminal struct {
W, H int
// contains filtered or unexported fields
}
func NewTerminal ¶
func (*Terminal) RefreshSize ¶
type TmuxKeys ¶
type TmuxKeys struct {
// contains filtered or unexported fields
}
TmuxKeys manages tmux's server-wide extended-keys option for the lifetime of the app. plums asks the terminal to distinguish modified keys like Shift+Enter (CSI-u / modifyOtherKeys), but tmux only forwards those to the application when extended-keys is enabled; with the common default of "off" Shift+Enter arrives as a bare Enter, which inserts a newline instead of submitting in split layout. EnableTmuxExtendedKeys turns it on at startup and Restore puts the prior value back on exit.
func EnableTmuxExtendedKeys ¶
func EnableTmuxExtendedKeys() *TmuxKeys
EnableTmuxExtendedKeys enables tmux extended-keys when running inside tmux and the option is not already on. It returns a handle whose Restore method undoes the change; both are no-ops outside tmux or when tmux is unavailable.