Source File
xterm.go
Belonging Package
github.com/charmbracelet/x/ansi
package ansiimport// KeyModifierOptions (XTMODKEYS) sets/resets xterm key modifier options.//// Default is 0.//// CSI > Pp m// CSI > Pp ; Pv m//// If Pv is omitted, the resource is reset to its initial value.//// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_func ( int, ...int) string {var , stringif > 0 {= strconv.Itoa()}if len() == 0 {return "\x1b[>" + strconv.Itoa() + "m"}:= [0]if > 0 {= strconv.Itoa()return "\x1b[>" + + ";" + + "m"}return "\x1b[>" + + "m"}// XTMODKEYS is an alias for [KeyModifierOptions].func ( int, ...int) string {return KeyModifierOptions(, ...)}// SetKeyModifierOptions sets xterm key modifier options.// This is an alias for [KeyModifierOptions].func ( int, int) string {return KeyModifierOptions(, )}// ResetKeyModifierOptions resets xterm key modifier options.// This is an alias for [KeyModifierOptions].func ( int) string {return KeyModifierOptions()}// QueryKeyModifierOptions (XTQMODKEYS) requests xterm key modifier options.//// Default is 0.//// CSI ? Pp m//// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_func ( int) string {var stringif > 0 {= strconv.Itoa()}return "\x1b[?" + + "m"}// XTQMODKEYS is an alias for [QueryKeyModifierOptions].func ( int) string {return QueryKeyModifierOptions()}// Modify Other Keys (modifyOtherKeys) is an xterm feature that allows the// terminal to modify the behavior of certain keys to send different escape// sequences when pressed.//// See: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeysconst (SetModifyOtherKeys1 = "\x1b[>4;1m"SetModifyOtherKeys2 = "\x1b[>4;2m"ResetModifyOtherKeys = "\x1b[>4m"QueryModifyOtherKeys = "\x1b[?4m")// ModifyOtherKeys returns a sequence that sets XTerm modifyOtherKeys mode.// The mode argument specifies the mode to set.//// 0: Disable modifyOtherKeys mode.// 1: Enable modifyOtherKeys mode 1.// 2: Enable modifyOtherKeys mode 2.//// CSI > 4 ; mode m//// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_// See: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys//// Deprecated: use [SetModifyOtherKeys1] or [SetModifyOtherKeys2] instead.func ( int) string {return "\x1b[>4;" + strconv.Itoa() + "m"}// DisableModifyOtherKeys disables the modifyOtherKeys mode.//// CSI > 4 ; 0 m//// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_// See: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys//// Deprecated: use [ResetModifyOtherKeys] instead.const DisableModifyOtherKeys = "\x1b[>4;0m"// EnableModifyOtherKeys1 enables the modifyOtherKeys mode 1.//// CSI > 4 ; 1 m//// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_// See: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys//// Deprecated: use [SetModifyOtherKeys1] instead.const EnableModifyOtherKeys1 = "\x1b[>4;1m"// EnableModifyOtherKeys2 enables the modifyOtherKeys mode 2.//// CSI > 4 ; 2 m//// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_// See: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys//// Deprecated: use [SetModifyOtherKeys2] instead.const EnableModifyOtherKeys2 = "\x1b[>4;2m"// RequestModifyOtherKeys requests the modifyOtherKeys mode.//// CSI ? 4 m//// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_// See: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys//// Deprecated: use [QueryModifyOtherKeys] instead.const RequestModifyOtherKeys = "\x1b[?4m"
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64)