module

Ansi

Constants

ACK = C0::ACK
AltScreenBufferMode = DECMode.new(1049)

Alternate Screen Buffer mode.

Deprecated: use [ModeAltScreenSaveCursor] instead.

AltScreenMode = DECMode.new(1047)

Alternate Screen Mode determines whether the alternate screen buffer is active.

Deprecated: use [ModeAltScreen] instead.

AltScreenSaveCursorMode = DECMode.new(1049)

Alternate Screen Save Cursor Mode saves the cursor position and switches to alternate screen.

Deprecated: use [ModeAltScreenSaveCursor] instead.

AnyEventMouseMode = DECMode.new(1003)

Any Event Mouse Tracking reports all motion events.

Deprecated: use [ModeMouseAnyEvent] instead.

APC = C1::APC
AttrBlackBackgroundColor = 40
AttrBlackForegroundColor = 30
AttrBlink = 5
AttrBlueBackgroundColor = 44
AttrBlueForegroundColor = 34
AttrBold = 1
AttrBrightBlackBackgroundColor = 100
AttrBrightBlackForegroundColor = 90
AttrBrightBlueBackgroundColor = 104
AttrBrightBlueForegroundColor = 94
AttrBrightCyanBackgroundColor = 106
AttrBrightCyanForegroundColor = 96
AttrBrightGreenBackgroundColor = 102
AttrBrightGreenForegroundColor = 92
AttrBrightMagentaBackgroundColor = 105
AttrBrightMagentaForegroundColor = 95
AttrBrightRedBackgroundColor = 101
AttrBrightRedForegroundColor = 91
AttrBrightWhiteBackgroundColor = 107
AttrBrightWhiteForegroundColor = 97
AttrBrightYellowBackgroundColor = 103
AttrBrightYellowForegroundColor = 93
AttrConceal = 8
AttrCyanBackgroundColor = 46
AttrCyanForegroundColor = 36
AttrDefaultBackgroundColor = 49
AttrDefaultForegroundColor = 39
AttrDefaultUnderlineColor = 59
AttrExtendedBackgroundColor = 48
AttrExtendedColorIntroducer = 5
AttrExtendedForegroundColor = 38
AttrExtendedUnderlineColor = 58
AttrFaint = 2
AttrGreenBackgroundColor = 42
AttrGreenForegroundColor = 32
AttrItalic = 3
AttrMagentaBackgroundColor = 45
AttrMagentaForegroundColor = 35
AttrNoBlink = 25
AttrNoConceal = 28
AttrNoItalic = 23
AttrNoReverse = 27
AttrNormalIntensity = 22
AttrNoStrikethrough = 29
AttrNoUnderline = 24
AttrRapidBlink = 6
AttrRedBackgroundColor = 41
AttrRedForegroundColor = 31
AttrReset = 0

SGR (Select Graphic Rendition) style attributes. See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters

AttrReverse = 7
AttrRGBColorIntroducer = 2
AttrStrikethrough = 9
AttrUnderline = 4
AttrWhiteBackgroundColor = 47
AttrWhiteForegroundColor = 37
AttrYellowBackgroundColor = 43
AttrYellowForegroundColor = 33
AutoWrapMode = DECMode.new(7)

Auto Wrap Mode (DECAWM) determines whether the cursor wraps to the next line.

Deprecated: use [ModeAutoWrap] instead.

BackarrowKeyMode = DECMode.new(67)

Backarrow Key Mode (DECBKM) determines whether the backspace key sends backspace or delete.

Deprecated: use [ModeBackarrowKey] instead.

BDSM = ModeBiDirectionalSupport
BEL = C0::BEL
BiDirectionalSupportMode = ANSIMode.new(8)

BiDirectional Support Mode (BDSM) determines whether the terminal supports bidirectional text.

Deprecated: use [ModeBiDirectionalSupport] instead.

BlackBackgroundColorAttr = AttrBlackBackgroundColor
BlackForegroundColorAttr = AttrBlackForegroundColor
BlueBackgroundColorAttr = AttrBlueBackgroundColor
BlueForegroundColorAttr = AttrBlueForegroundColor
Blur = "\e[O"

Blur is an escape sequence to notify the terminal that it has lost focus. This is used with [ModeFocusEvent].

BoldAttr = AttrBold
BPH = C1::BPH
BracketedPasteEnd = "\e[201~"

BracketedPasteEnd is the control sequence to disable bracketed paste mode.

BracketedPasteMode = DECMode.new(2004)

Bracketed Paste Mode determines whether pasted text is bracketed with escape sequences.

Deprecated: use [ModeBracketedPaste] instead.

BracketedPasteStart = "\e[200~"

BracketedPasteStart is the control sequence to enable bracketed paste mode.

BrightBlackBackgroundColorAttr = AttrBrightBlackBackgroundColor
BrightBlackForegroundColorAttr = AttrBrightBlackForegroundColor
BrightBlueBackgroundColorAttr = AttrBrightBlueBackgroundColor
BrightBlueForegroundColorAttr = AttrBrightBlueForegroundColor
BrightCyanBackgroundColorAttr = AttrBrightCyanBackgroundColor
BrightCyanForegroundColorAttr = AttrBrightCyanForegroundColor
BrightGreenBackgroundColorAttr = AttrBrightGreenBackgroundColor
BrightGreenForegroundColorAttr = AttrBrightGreenForegroundColor
BrightMagentaBackgroundColorAttr = AttrBrightMagentaBackgroundColor
BrightMagentaForegroundColorAttr = AttrBrightMagentaForegroundColor
BrightRedBackgroundColorAttr = AttrBrightRedBackgroundColor
BrightRedForegroundColorAttr = AttrBrightRedForegroundColor
BrightWhiteBackgroundColorAttr = AttrBrightWhiteBackgroundColor
BrightWhiteForegroundColorAttr = AttrBrightWhiteForegroundColor
BrightYellowBackgroundColorAttr = AttrBrightYellowBackgroundColor
BrightYellowForegroundColorAttr = AttrBrightYellowForegroundColor
BS = C0::BS
ButtonEventMouseMode = DECMode.new(1002)

Button Event Mouse Tracking reports button-motion events when a button is pressed.

Deprecated: use [ModeMouseButtonEvent] instead.

CAN = C0::CAN
CCH = C1::CCH
ConcealAttr = AttrConceal
CR = C0::CR
CSI = C1::CSI
CUB1 = "\e[D"

CUB1 is a sequence for moving the cursor left one cell.

CUD1 = "\e[B"

CUD1 is a sequence for moving the cursor down one cell.

CUF1 = "\e[C"

CUF1 is a sequence for moving the cursor right one cell.

CursorDown1 = "\e[B"

CursorDown1 is a sequence for moving the cursor down one cell.

This is equivalent to CursorDown(1).

Deprecated: use [CUD1] instead.

CursorEnableMode = DECMode.new(25)

Text Cursor Enable mode.

Deprecated: use [SetModeTextCursorEnable] and [ResetModeTextCursorEnable] instead.

CursorHomePosition = "\e[H"

CursorHomePosition is a sequence for moving the cursor to the upper left corner of the scrolling region.

This is equivalent to [cursor_position](1, 1).

CursorKeysMode = DECMode.new(1)

Cursor Keys Mode (DECCKM) determines whether cursor keys send ANSI or application sequences.

Deprecated: use [ModeCursorKeys] instead.

CursorLeft1 = CUB1

CursorLeft1 is a sequence for moving the cursor left one cell.

This is equivalent to CursorLeft(1).

Deprecated: use [CUB1] instead.

CursorOrigin = "\e[1;1H"

CursorOrigin is a sequence for moving the cursor to the upper left corner of the display. This is equivalent to set_cursor_position(1, 1).

Deprecated: use [CursorHomePosition] instead.

CursorRight1 = CUF1

CursorRight1 is a sequence for moving the cursor right one cell.

This is equivalent to CursorRight(1).

Deprecated: use [CUF1] instead.

CursorUp1 = "\e[A"

CursorUp1 is a sequence for moving the cursor up one cell.

This is equivalent to CursorUp(1).

Deprecated: use [CUU1] instead.

CUU1 = "\e[A"

CUU1 is a sequence for moving the cursor up one cell.

CyanBackgroundColorAttr = AttrCyanBackgroundColor
CyanForegroundColorAttr = AttrCyanForegroundColor
DC1 = C0::DC1
DC2 = C0::DC2
DC3 = C0::DC3
DC4 = C0::DC4
DCS = C1::DCS
DECAWM = ModeAutoWrap
DECBKM = ModeBackarrowKey
DECCKM = ModeCursorKeys
DECKPAM = KeypadApplicationMode
DECKPNM = KeypadNumericMode
DECLRMM = ModeLeftRightMargin
DECNKM = ModeNumericKeypad
DECOM = ModeOrigin
DECRC = RestoreCursor
DECSC = SaveCursor
DECST8C = SetTabEvery8Columns
DECTCEM = ModeTextCursorEnable
DefaultBackgroundColorAttr = AttrDefaultBackgroundColor
DefaultForegroundColorAttr = AttrDefaultForegroundColor
DefaultUnderlineColorAttr = AttrDefaultUnderlineColor
DEL = ASCII::DEL
DisableAltScreenBuffer = "\e[?1049l"
DisableBracketedPaste = "\e[?2004l"
DisableCursorKeys = "\e[?1l"
DisableGraphemeClustering = "\e[?2027l"
DisableKittyKeyboard = "\e[>u"

DisableKittyKeyboard is a sequence to push zero into the terminal Kitty Keyboard stack to disable the protocol.

This is equivalent to PushKittyKeyboard(0).

DisableModifyOtherKeys = "\e[>4;0m"

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.

DisableMouse = "\e[?1000l"
DisableMouseAllMotion = "\e[?1003l"
DisableMouseCellMotion = "\e[?1002l"
DisableMouseHilite = "\e[?1001l"
DisableMouseSgrExt = "\e[?1006l"
DisableReportFocus = "\e[?1004l"
DisableSyncdOutput = "\e[?2026l"
DisableWin32Input = "\e[?9001l"
DLE = C0::DLE
EM = C0::EM
EnableAltScreenBuffer = "\e[?1049h"
EnableBracketedPaste = "\e[?2004h"

Deprecated: use [SetModeBracketedPaste], [ResetModeBracketedPaste], and [RequestModeBracketedPaste] instead.

EnableCursorKeys = "\e[?1h"

Cursor Keys mode.

Deprecated: use [SetModeCursorKeys] and [ResetModeCursorKeys] instead.

EnableGraphemeClustering = "\e[?2027h"

Unicode Core mode.

Deprecated: use [SetModeUnicodeCore], [ResetModeUnicodeCore], and [RequestModeUnicodeCore] instead.

EnableModifyOtherKeys1 = "\e[>4;1m"

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.

EnableModifyOtherKeys2 = "\e[>4;2m"

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.

EnableMouse = "\e[?1000h"
EnableMouseAllMotion = "\e[?1003h"
EnableMouseCellMotion = "\e[?1002h"
EnableMouseHilite = "\e[?1001h"
EnableMouseSgrExt = "\e[?1006h"
EnableReportFocus = "\e[?1004h"
EnableSyncdOutput = "\e[?2026h"
EnableWin32Input = "\e[?9001h"

Deprecated: use [SetModeWin32Input], [ResetModeWin32Input], and [RequestModeWin32Input] instead.

ENQ = C0::ENQ
EOT = C0::EOT
EPA = C1::EPA
EraseEntireDisplay = "\e[3J"
EraseEntireLine = "\e[2K"
EraseEntireScreen = "\e[2J"
EraseLineLeft = "\e[1K"
EraseLineRight = "\e[K"

EraseLine constants. These are the possible values for the EraseLine function.

EraseScreenAbove = "\e[1J"
EraseScreenBelow = "\e[J"

EraseDisplay constants. These are the possible values for the EraseDisplay function.

ESA = C1::ESA
ESC = C0::ESC
EscapeState = 4_u8
ETB = C0::ETB
ETX = C0::ETX
ExtendedBackgroundColorAttr = AttrExtendedBackgroundColor
ExtendedColorIntroducerAttr = AttrExtendedColorIntroducer
ExtendedForegroundColorAttr = AttrExtendedForegroundColor
ExtendedUnderlineColorAttr = AttrExtendedUnderlineColor
FaintAttr = AttrFaint
FF = C0::FF
Focus = "\e[I"

Focus is an escape sequence to notify the terminal that it has focus. This is used with [ModeFocusEvent].

FocusEventMode = DECMode.new(1004)

Focus Event Mode determines whether the terminal reports focus and blur events.

Deprecated: use [ModeFocusEvent] instead.

FS = C0::FS
GraphemeClusteringMode = DECMode.new(2027)

Grapheme Clustering Mode determines whether the terminal looks for grapheme clusters.

Deprecated: use [ModeUnicodeCore], [SetModeUnicodeCore], [ResetModeUnicodeCore], and [RequestModeUnicodeCore] instead.

GraphemeWidth = Method::GraphemeWidth
GreenBackgroundColorAttr = AttrGreenBackgroundColor
GreenForegroundColorAttr = AttrGreenForegroundColor
GS = C0::GS
HideCursor = ResetModeTextCursorEnable
HighlightMouseMode = DECMode.new(1001)

Highlight Mouse Tracking determines whether the mouse reports on button presses and highlighted cells.

Deprecated: use [ModeMouseHighlight] instead.

HomeCursorPosition = CursorHomePosition

HomeCursorPosition is a sequence for moving the cursor to the upper left corner of the scrolling region. This is equivalent to set_cursor_position(1, 1).

Deprecated: use [CursorHomePosition] instead.

HOP = C1::HOP
HorizontalTabSet = "\eH"

HorizontalTabSet (HTS) sets a horizontal tab stop at the current cursor column.

This is equivalent to [HTS].

ESC H

See: https://vt100.net/docs/vt510-rm/HTS.html

HorizontalVerticalHomePosition = "\e[f"

HorizontalVerticalHomePosition is a sequence for moving the cursor to the upper left corner of the scrolling region. This is equivalent to horizontal_vertical_position(1, 1).

HT = C0::HT
HTJ = C1::HTJ
HTS = C1::HTS
InBandResizeMode = DECMode.new(2048)

In Band Resize Mode reports terminal resize events as escape sequences.

Deprecated: use [ModeInBandResize] instead.

IND = C1::IND
Index = "\eD"

Index (IND) is an escape sequence for moving the cursor down one line in the same column. If the cursor is at the bottom margin, the screen scrolls up. This has the same effect as [IND].

InsertReplaceMode = ANSIMode.new(4)

Insert/Replace Mode (IRM) determines whether characters are inserted or replaced.

Deprecated: use [ModeInsertReplace] instead.

IntermedState = 3_u8
IRM = ModeInsertReplace
ItalicAttr = AttrItalic
KAM = ModeKeyboardAction
KeyboardActionMode = ANSIMode.new(2)

Keyboard Action Mode (KAM) controls locking of the keyboard.

Deprecated: use [ModeKeyboardAction] instead.

KeypadApplicationMode = "\e="

Keypad Application Mode (DECKPAM) is a mode that determines whether the keypad sends application sequences or ANSI sequences.

This works like enabling [DECNKM]. Use [ModeNumericKeypad] to set the numeric keypad mode.

ESC =

See: https://vt100.net/docs/vt510-rm/DECKPAM.html

KeypadNumericMode = "\e>"

Keypad Numeric Mode (DECKPNM) is a mode that determines whether the keypad sends application sequences or ANSI sequences.

This works the same as disabling [DECNKM].

ESC >

See: https://vt100.net/docs/vt510-rm/DECKPNM.html

KittyAllFlags = (((KittyDisambiguateEscapeCodes | KittyReportEventTypes) | KittyReportAlternateKeys) | KittyReportAllKeysAsEscapeCodes) | KittyReportAssociatedKeys
KittyDisambiguateEscapeCodes = 1

Kitty keyboard protocol progressive enhancement flags. See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement

KittyReportAllKeysAsEscapeCodes = 1 << 3
KittyReportAlternateKeys = 1 << 2
KittyReportAssociatedKeys = 1 << 4
KittyReportEventTypes = 1 << 1
LeftRightMarginMode = DECMode.new(69)

Left Right Margin Mode (DECLRMM) determines whether left and right margins can be set.

Deprecated: use [ModeLeftRightMargin] instead.

LF = C0::LF
LightDarkMode = DECMode.new(2031)

Light Dark Mode enables reporting the operating system's color scheme preference.

Deprecated: use [ModeLightDark] instead.

LineFeedNewLineMode = ANSIMode.new(20)

Line Feed/New Line Mode (LNM) determines whether the terminal interprets line feed as new line.

Deprecated: use [ModeLineFeedNewLine] instead.

LNM = ModeLineFeedNewLine
LocalEchoMode = SendReceiveMode
LS0 = C0::LS0
LS1 = C0::LS1
LS1R = "\e~"

LS1R (Locking Shift 1 Right) shifts G1 into GR character set.

LS2 = "\en"

LS2 (Locking Shift 2) shifts G2 into GL character set.

LS2R = "\e}"

LS2R (Locking Shift 2 Right) shifts G2 into GR character set.

LS3 = "\eo"

LS3 (Locking Shift 3) shifts G3 into GL character set.

LS3R = "\e|"

LS3R (Locking Shift 3 Right) shifts G3 into GR character set.

MagentaBackgroundColorAttr = AttrMagentaBackgroundColor
MagentaForegroundColorAttr = AttrMagentaForegroundColor
ModeAltScreen = DECMode.new(1047)

Alternate Screen Mode

ModeAltScreenSaveCursor = DECMode.new(1049)

Alternate Screen Save Cursor Mode

ModeAutoWrap = DECMode.new(7)

Auto Wrap Mode (DECAWM)

ModeBackarrowKey = DECMode.new(67)

Backarrow Key Mode (DECBKM)

ModeBiDirectionalSupport = ANSIMode.new(8)

BiDirectional Support Mode (BDSM)

ModeBracketedPaste = DECMode.new(2004)

Bracketed Paste Mode

ModeCursorKeys = DECMode.new(1)

Cursor Keys Mode (DECCKM)

ModeFocusEvent = DECMode.new(1004)

Focus Event Mode

ModeInBandResize = DECMode.new(2048)

In Band Resize Mode

ModeInsertReplace = ANSIMode.new(4)

Insert/Replace Mode (IRM)

ModeKeyboardAction = ANSIMode.new(2)

Keyboard Action Mode (KAM)

ModeLeftRightMargin = DECMode.new(69)

Left Right Margin Mode (DECLRMM)

ModeLightDark = DECMode.new(2031)

Light/Dark Mode

ModeLineFeedNewLine = ANSIMode.new(20)

Line Feed/New Line Mode (LNM)

ModeLocalEcho = ModeSendReceive
ModeMouseAnyEvent = DECMode.new(1003)

Any Event Mouse Mode

ModeMouseButtonEvent = DECMode.new(1002)

Button Event Mouse Mode

ModeMouseExtSgr = DECMode.new(1006)

SGR Extended Mouse Mode

ModeMouseExtSgrPixel = DECMode.new(1016)

SGR Pixel Extended Mouse Mode

ModeMouseExtUrxvt = DECMode.new(1015)

URXVT Extended Mouse Mode

ModeMouseExtUtf8 = DECMode.new(1005)

UTF-8 Extended Mouse Mode

ModeMouseHighlight = DECMode.new(1001)

Highlight Mouse Mode

ModeMouseNormal = DECMode.new(1000)

Normal Mouse Mode

ModeMouseX10 = DECMode.new(9)

X10 Mouse Mode

ModeNotRecognized = ModeSetting::ModeNotRecognized
ModeNumericKeypad = DECMode.new(66)

Numeric Keypad Mode (DECNKM)

ModeOrigin = DECMode.new(6)

Origin Mode (DECOM)

ModePermanentlyReset = ModeSetting::ModePermanentlyReset
ModePermanentlySet = ModeSetting::ModePermanentlySet
ModeReset = ModeSetting::ModeReset
ModeSaveCursor = DECMode.new(1048)

Save Cursor Mode

ModeSendReceive = ANSIMode.new(12)

Send Receive Mode (SRM) / Local Echo

ModeSet = ModeSetting::ModeSet
ModeSynchronizedOutput = DECMode.new(2026)

Synchronized Output Mode

ModeTextCursorEnable = DECMode.new(25)

Text Cursor Enable Mode (DECTCEM)

ModeUnicodeCore = DECMode.new(2027)

Unicode Core Mode

ModeWin32Input = DECMode.new(9001)

Win32 Input Mode

MouseAllMotionMode = DECMode.new(1003)

All Mouse Tracking mode.

Deprecated: use [ModeMouseAnyEvent] instead.

MouseBackward = MouseButton8
MouseButton1 = MouseButton.new(1_u8)
MouseButton10 = MouseButton.new(10_u8)
MouseButton11 = MouseButton.new(11_u8)
MouseButton2 = MouseButton.new(2_u8)
MouseButton3 = MouseButton.new(3_u8)
MouseButton4 = MouseButton.new(4_u8)
MouseButton5 = MouseButton.new(5_u8)
MouseButton6 = MouseButton.new(6_u8)
MouseButton7 = MouseButton.new(7_u8)
MouseButton8 = MouseButton.new(8_u8)
MouseButton9 = MouseButton.new(9_u8)
MouseCellMotionMode = DECMode.new(1002)

Cell Motion Mouse Tracking mode.

Deprecated: use [ModeMouseButtonEvent] instead.

MouseForward = MouseButton9
MouseHiliteMode = DECMode.new(1001)

VT Hilite Mouse Tracking mode.

Deprecated: use [ModeMouseHighlight] instead.

MouseLeft = MouseButton1
MouseMiddle = MouseButton2
MouseMode = DECMode.new(1000)

VT Mouse Tracking mode.

Deprecated: use [ModeMouseNormal] instead.

MouseNone = MouseButton.new(0_u8)
MouseRelease = MouseNone
MouseRight = MouseButton3
MouseSgrExtMode = DECMode.new(1006)

Mouse SGR Extended mode.

Deprecated: use [ModeMouseExtSgr], [SetModeMouseExtSgr], [ResetModeMouseExtSgr], and [RequestModeMouseExtSgr] instead.

MouseWheelDown = MouseButton5
MouseWheelLeft = MouseButton6
MouseWheelRight = MouseButton7
MouseWheelUp = MouseButton4
MoveCursorOrigin = CursorOrigin

MoveCursorOrigin is a sequence for moving the cursor to the upper left corner of the display. This is equivalent to set_cursor_position(1, 1).

Deprecated: use [CursorHomePosition] instead.

MW = C1::MW
NAK = C0::NAK
NBH = C1::NBH
NBSP = '\u00A0'
NEL = C1::NEL
NoBlinkAttr = AttrNoBlink
NoConcealAttr = AttrNoConceal
NoItalicAttr = AttrNoItalic
NoReverseAttr = AttrNoReverse
NormalIntensityAttr = AttrNormalIntensity
NormalMouseMode = DECMode.new(1000)

Normal Mouse Mode determines whether the mouse reports on button presses and releases.

Deprecated: use [ModeMouseNormal] instead.

NormalState = 0_u8
NoStrikethroughAttr = AttrNoStrikethrough
NoUnderlineAttr = AttrNoUnderline
NUL = C0::NUL

Constants for easy access at module top level

NumericKeypadMode = DECMode.new(66)

Numeric Keypad Mode (DECNKM) determines whether the keypad sends application or numeric sequences.

Deprecated: use [ModeNumericKeypad] instead.

OriginMode = DECMode.new(6)

Origin Mode (DECOM) determines whether the cursor moves to home or margin position.

Deprecated: use [ModeOrigin] instead.

OSC = C1::OSC
PAD = C1::PAD

Constants for easy access at module top level

ParamsState = 2_u8
PLD = C1::PLD
PLU = C1::PLU
PM = C1::PM
PrefixState = 1_u8
PrimaryClipboard = 'p'.ord.to_u8
PU1 = C1::PU1
PU2 = C1::PU2
QueryModifyOtherKeys = "\e[?4m"
RapidBlinkAttr = AttrRapidBlink
RedBackgroundColorAttr = AttrRedBackgroundColor
RedForegroundColorAttr = AttrRedForegroundColor
ReportFocusMode = DECMode.new(1004)

Focus reporting mode.

Deprecated: use [SetModeFocusEvent], [ResetModeFocusEvent], and [RequestModeFocusEvent] instead.

RequestAltScreenBuffer = "\e[?1049$p"
RequestAltScreenBufferMode = "\e[?1049$p"
RequestAltScreenMode = "\e[?1047$p"
RequestAltScreenSaveCursorMode = "\e[?1049$p"
RequestAnyEventMouseMode = "\e[?1003$p"
RequestAutoWrapMode = "\e[?7$p"
RequestBackarrowKeyMode = "\e[?67$p"
RequestBackgroundColor = "\e]11;?\a"

RequestBackgroundColor is a sequence that requests the current default terminal background color.

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands

RequestBiDirectionalSupportMode = "\e[8$p"
RequestBracketedPaste = "\e[?2004$p"
RequestBracketedPasteMode = "\e[?2004$p"
RequestButtonEventMouseMode = "\e[?1002$p"
RequestCellSizeWinOp = 16

RequestCellSizeWinOp is a window operation that requests a report of the size of the terminal cell size in pixels. The response is in the form: CSI 6 ; height ; width t

Deprecated: Use constant number directly with [window_op].

RequestCursorColor = "\e]12;?\a"

RequestCursorColor is a sequence that requests the current terminal cursor color.

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands

RequestCursorKeysMode = "\e[?1$p"
RequestCursorPosition = "\e[6n"

RequestCursorPosition is an escape sequence that requests the current cursor position.

CSI 6 n

The terminal will report the cursor position as a CSI sequence in the following format:

CSI Pl ; Pc R

Where Pl is the line number and Pc is the column number. See: https://vt100.net/docs/vt510-rm/CPR.html

Deprecated: use [RequestCursorPositionReport] instead.

RequestCursorPositionReport = "\e[6n"

RequestCursorPositionReport is an escape sequence that requests the current cursor position.

CSI 6 n

The terminal will report the cursor position as a CSI sequence in the following format:

CSI Pl ; Pc R

Where Pl is the line number and Pc is the column number. See: https://vt100.net/docs/vt510-rm/CPR.html

RequestCursorVisibility = "\e[?25$p"
RequestExtendedCursorPosition = "\e[?6n"

RequestExtendedCursorPosition (DECXCPR) is a sequence for requesting the cursor position report including the current page number.

CSI ? 6 n

The terminal will report the cursor position as a CSI sequence in the following format:

CSI ? Pl ; Pc ; Pp R

Where Pl is the line number, Pc is the column number, and Pp is the page number. See: https://vt100.net/docs/vt510-rm/DECXCPR.html

Deprecated: use [RequestExtendedCursorPositionReport] instead.

RequestExtendedCursorPositionReport = "\e[?6n"

RequestExtendedCursorPositionReport (DECXCPR) is a sequence for requesting the cursor position report including the current page number.

CSI ? 6 n

The terminal will report the cursor position as a CSI sequence in the following format:

CSI ? Pl ; Pc ; Pp R

Where Pl is the line number, Pc is the column number, and Pp is the page number. See: https://vt100.net/docs/vt510-rm/DECXCPR.html

RequestFocusEventMode = "\e[?1004$p"
RequestForegroundColor = "\e]10;?\a"

RequestForegroundColor is a sequence that requests the current default terminal foreground color.

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands

RequestGraphemeClustering = "\e[?2027$p"
RequestGraphemeClusteringMode = "\e[?2027$p"
RequestHighlightMouseMode = "\e[?1001$p"
RequestInBandResizeMode = "\e[?2048$p"
RequestInsertReplaceMode = "\e[4$p"
RequestKeyboardActionMode = "\e[2$p"
RequestKittyKeyboard = "\e[?u"

RequestKittyKeyboard is a sequence to request the terminal Kitty keyboard protocol enabled flags.

See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/

RequestLeftRightMarginMode = "\e[?69$p"
RequestLightDarkMode = "\e[?2031$p"
RequestLightDarkReport = "\e[?996n"

RequestLightDarkReport is a control sequence that requests the terminal to report its operating system light/dark color preference. Supported terminals should respond with a [LightDarkReport] sequence as follows:

CSI ? 997 ; 1 n   for dark mode
CSI ? 997 ; 2 n   for light mode

See: https://contour-terminal.org/vt-extensions/color-palette-update-notifications/

RequestLineFeedNewLineMode = "\e[20$p"
RequestLocalEchoMode = "\e[12$p"
RequestModeAltScreen = "\e[?1047$p"
RequestModeAltScreenSaveCursor = "\e[?1049$p"
RequestModeAutoWrap = "\e[?7$p"
RequestModeBackarrowKey = "\e[?67$p"
RequestModeBiDirectionalSupport = "\e[8$p"
RequestModeBracketedPaste = "\e[?2004$p"
RequestModeCursorKeys = "\e[?1$p"
RequestModeFocusEvent = "\e[?1004$p"
RequestModeInBandResize = "\e[?2048$p"
RequestModeInsertReplace = "\e[4$p"
RequestModeKeyboardAction = "\e[2$p"
RequestModeLeftRightMargin = "\e[?69$p"
RequestModeLightDark = "\e[?2031$p"
RequestModeLineFeedNewLine = "\e[20$p"
RequestModeLocalEcho = "\e[12$p"
RequestModeMouseAnyEvent = "\e[?1003$p"
RequestModeMouseButtonEvent = "\e[?1002$p"
RequestModeMouseExtSgr = "\e[?1006$p"
RequestModeMouseExtSgrPixel = "\e[?1016$p"
RequestModeMouseExtUrxvt = "\e[?1015$p"
RequestModeMouseExtUtf8 = "\e[?1005$p"
RequestModeMouseHighlight = "\e[?1001$p"
RequestModeMouseNormal = "\e[?1000$p"
RequestModeMouseX10 = "\e[?9$p"
RequestModeNumericKeypad = "\e[?66$p"
RequestModeOrigin = "\e[?6$p"
RequestModeSaveCursor = "\e[?1048$p"
RequestModeSendReceive = "\e[12$p"
RequestModeSynchronizedOutput = "\e[?2026$p"
RequestModeTextCursorEnable = "\e[?25$p"
RequestModeUnicodeCore = "\e[?2027$p"
RequestModeWin32Input = "\e[?9001$p"
RequestModifyOtherKeys = "\e[?4m"

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.

RequestMouse = "\e[?1000$p"
RequestMouseAllMotion = "\e[?1003$p"
RequestMouseCellMotion = "\e[?1002$p"
RequestMouseHilite = "\e[?1001$p"
RequestMouseSgrExt = "\e[?1006$p"
RequestNameVersion = "\e[>q"

RequestNameVersion (XTVERSION) is a control sequence that requests the terminal's name and version. It responds with a DSR sequence identifying the terminal.

CSI > 0 q
DCS > | text ST

See https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-PC-Style-Function-Keys

RequestNormalMouseMode = "\e[?1000$p"
RequestNumericKeypadMode = "\e[?66$p"
RequestOriginMode = "\e[?6$p"
RequestPrimaryClipboard = "\e]52;p;?\a"

RequestPrimaryClipboard is a sequence for requesting the primary clipboard.

This is equivalent to RequestClipboard(PrimaryClipboard).

RequestPrimaryDeviceAttributes = "\e[c"

RequestPrimaryDeviceAttributes is a control sequence that requests the terminal's primary device attributes (DA1).

CSI c

See https://vt100.net/docs/vt510-rm/DA1.html

RequestReportFocus = "\e[?1004$p"
RequestSaveCursorMode = "\e[?1048$p"
RequestSecondaryDeviceAttributes = "\e[>c"

RequestSecondaryDeviceAttributes is a control sequence that requests the terminal's secondary device attributes (DA2).

CSI > c

See https://vt100.net/docs/vt510-rm/DA2.html

RequestSendReceiveMode = "\e[12$p"
RequestSgrExtMouseMode = "\e[?1006$p"
RequestSgrPixelExtMouseMode = "\e[?1016$p"
RequestSyncdOutput = "\e[?2026$p"
RequestSynchronizedOutputMode = "\e[?2026$p"
RequestSystemClipboard = "\e]52;c;?\a"

RequestSystemClipboard is a sequence for requesting the system clipboard.

This is equivalent to RequestClipboard(SystemClipboard).

RequestTertiaryDeviceAttributes = "\e[=c"

RequestTertiaryDeviceAttributes is a control sequence that requests the terminal's tertiary device attributes (DA3).

CSI = c

See https://vt100.net/docs/vt510-rm/DA3.html

RequestTextCursorEnableMode = "\e[?25$p"
RequestUnicodeCoreMode = "\e[?2027$p"
RequestUrxvtExtMouseMode = "\e[?1015$p"
RequestUtf8ExtMouseMode = "\e[?1005$p"
RequestWin32Input = "\e[?9001$p"
RequestWin32InputMode = "\e[?9001$p"
RequestWindowSizeWinOp = 14

RequestWindowSizeWinOp is a window operation that requests a report of the size of the terminal window in pixels. The response is in the form: CSI 4 ; height ; width t

Deprecated: Use constant number directly with [window_op].

RequestX10MouseMode = "\e[?9$p"
RequestXTVersion = RequestNameVersion

RequestXTVersion is a control sequence that requests the terminal's XTVERSION. It responds with a DSR sequence identifying the version.

CSI > Ps q
DCS > | text ST

See https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-PC-Style-Function-Keys

Deprecated: use [RequestNameVersion] instead.

ResetAltScreenBufferMode = "\e[?1049l"
ResetAltScreenMode = "\e[?1047l"
ResetAltScreenSaveCursorMode = "\e[?1049l"
ResetAnyEventMouseMode = "\e[?1003l"
ResetAttr = AttrReset

Deprecated: use Attr* constants instead.

ResetAutoWrapMode = "\e[?7l"
ResetBackarrowKeyMode = "\e[?67l"
ResetBackgroundColor = "\e]111\a"

ResetBackgroundColor is a sequence that resets the default terminal background color.

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands

ResetBiDirectionalSupportMode = "\e[8l"
ResetBracketedPasteMode = "\e[?2004l"
ResetButtonEventMouseMode = "\e[?1002l"
ResetCursorColor = "\e]112\a"

ResetCursorColor is a sequence that resets the terminal cursor color.

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands

ResetCursorKeysMode = "\e[?1l"
ResetFocusEventMode = "\e[?1004l"
ResetForegroundColor = "\e]110\a"

ResetForegroundColor is a sequence that resets the default terminal foreground color.

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands

ResetGraphemeClusteringMode = "\e[?2027l"
ResetHighlightMouseMode = "\e[?1001l"
ResetInBandResizeMode = "\e[?2048l"
ResetInitialState = "\ec"

ResetInitialState (RIS) resets the terminal to its initial state.

ESC c

See: https://vt100.net/docs/vt510-rm/RIS.html

ResetInsertReplaceMode = "\e[4l"
ResetKeyboardActionMode = "\e[2l"
ResetLeftRightMarginMode = "\e[?69l"
ResetLightDarkMode = "\e[?2031l"
ResetLineFeedNewLineMode = "\e[20l"
ResetLocalEchoMode = "\e[12l"
ResetModeAltScreen = "\e[?1047l"
ResetModeAltScreenSaveCursor = "\e[?1049l"
ResetModeAutoWrap = "\e[?7l"
ResetModeBackarrowKey = "\e[?67l"
ResetModeBiDirectionalSupport = "\e[8l"
ResetModeBracketedPaste = "\e[?2004l"
ResetModeCursorKeys = "\e[?1l"
ResetModeFocusEvent = "\e[?1004l"
ResetModeInBandResize = "\e[?2048l"
ResetModeInsertReplace = "\e[4l"
ResetModeKeyboardAction = "\e[2l"
ResetModeLeftRightMargin = "\e[?69l"
ResetModeLightDark = "\e[?2031l"
ResetModeLineFeedNewLine = "\e[20l"
ResetModeLocalEcho = "\e[12l"
ResetModeMouseAnyEvent = "\e[?1003l"
ResetModeMouseButtonEvent = "\e[?1002l"
ResetModeMouseExtSgr = "\e[?1006l"
ResetModeMouseExtSgrPixel = "\e[?1016l"
ResetModeMouseExtUrxvt = "\e[?1015l"
ResetModeMouseExtUtf8 = "\e[?1005l"
ResetModeMouseHighlight = "\e[?1001l"
ResetModeMouseNormal = "\e[?1000l"
ResetModeMouseX10 = "\e[?9l"
ResetModeNumericKeypad = "\e[?66l"
ResetModeOrigin = "\e[?6l"
ResetModeSaveCursor = "\e[?1048l"
ResetModeSendReceive = "\e[12l"
ResetModeSynchronizedOutput = "\e[?2026l"
ResetModeTextCursorEnable = "\e[?25l"
ResetModeUnicodeCore = "\e[?2027l"
ResetModeWin32Input = "\e[?9001l"
ResetModifyOtherKeys = "\e[>4m"
ResetNormalMouseMode = "\e[?1000l"
ResetNumericKeypadMode = "\e[?66l"
ResetOriginMode = "\e[?6l"
ResetPalette = "\e]R\a"

ResetPalette resets the color palette to the default values.

This sequence is specific to the Linux Console and may not work in other terminal emulators.

See https://man7.org/linux/man-pages/man4/console_codes.4.html

ResetPrimaryClipboard = "\e]52;p;\a"

ResetPrimaryClipboard is a sequence for resetting the primary clipboard.

This is equivalent to ResetClipboard(PrimaryClipboard).

ResetProgressBar = "\e]9;4;0\a"

ResetProgressBar is a sequence that resets the progress bar to its default state (hidden).

OSC 9 ; 4 ; 0 BEL

See: https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences

ResetSaveCursorMode = "\e[?1048l"
ResetSendReceiveMode = "\e[12l"
ResetSgrExtMouseMode = "\e[?1006l"
ResetSgrPixelExtMouseMode = "\e[?1016l"
ResetStyle = "\e[m"

ResetStyle is a SGR (Select Graphic Rendition) style sequence that resets all attributes. See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters

ResetSynchronizedOutputMode = "\e[?2026l"
ResetSystemClipboard = "\e]52;c;\a"

ResetSystemClipboard is a sequence for resetting the system clipboard.

This is equivalent to ResetClipboard(SystemClipboard).

ResetTextCursorEnableMode = "\e[?25l"
ResetUnicodeCoreMode = "\e[?2027l"
ResetUrxvtExtMouseMode = "\e[?1015l"
ResetUtf8ExtMouseMode = "\e[?1005l"
ResetWin32InputMode = "\e[?9001l"
ResetX10MouseMode = "\e[?9l"
ResizeWindowWinOp = 4

ResizeWindowWinOp is a window operation that resizes the terminal window.

Deprecated: Use constant number directly with [window_op].

RestoreCurrentCursorPosition = "\e[u"

RestoreCurrentCursorPosition (SCORC) is a sequence for restoring the current cursor position for SCO console mode.

CSI u

This acts like [DECRC], except the page number where the cursor was saved is not restored.

See: https://vt100.net/docs/vt510-rm/SCORC.html

RestoreCursor = "\e8"

RestoreCursor (DECRC) is an escape sequence that restores the cursor position.

ESC 8

See: https://vt100.net/docs/vt510-rm/DECRC.html

RestoreCursorPosition = "\e[u"

RestoreCursorPosition (RCP or SCORC) is a sequence for restoring the cursor position.

CSI u

This acts like Restore, except the cursor stays on the same page where the cursor was saved.

See: https://vt100.net/docs/vt510-rm/SCORC.html

Deprecated: use [RestoreCurrentCursorPosition] instead.

ReverseAttr = AttrReverse
ReverseIndex = "\eM"

ReverseIndex (RI) is an escape sequence for moving the cursor up one line in the same column. If the cursor is at the top margin, the screen scrolls down.

This has the same effect as [RI].

RGBColorIntroducerAttr = AttrRGBColorIntroducer
RI = C1::RI
RIS = ResetInitialState
RS = C0::RS
SaveCurrentCursorPosition = "\e[s"

SaveCurrentCursorPosition (SCOSC) is a sequence for saving the current cursor position for SCO console mode.

CSI s

This acts like [DECSC], except the page number where the cursor is located is not saved.

See: https://vt100.net/docs/vt510-rm/SCOSC.html

SaveCursor = "\e7"

SaveCursor (DECSC) is an escape sequence that saves the current cursor position.

ESC 7

See: https://vt100.net/docs/vt510-rm/DECSC.html

SaveCursorMode = DECMode.new(1048)

Save Cursor Mode saves the cursor position.

Deprecated: use [ModeSaveCursor] instead.

SaveCursorPosition = "\e[s"

SaveCursorPosition (SCP or SCOSC) is a sequence for saving the cursor position.

CSI s

This acts like Save, except the page number where the cursor is located is not saved.

See: https://vt100.net/docs/vt510-rm/SCOSC.html

Deprecated: use [SaveCurrentCursorPosition] instead.

SCI = C1::SCI
SCORC = RestoreCurrentCursorPosition
SCOSC = SaveCurrentCursorPosition
SendReceiveMode = ANSIMode.new(12)

Send Receive Mode (SRM) or Local Echo Mode determines whether the terminal echoes characters.

Deprecated: use [ModeSendReceive] instead.

SetAltScreenBufferMode = "\e[?1049h"
SetAltScreenMode = "\e[?1047h"
SetAltScreenSaveCursorMode = "\e[?1049h"
SetAnyEventMouseMode = "\e[?1003h"
SetAutoWrapMode = "\e[?7h"
SetBackarrowKeyMode = "\e[?67h"
SetBiDirectionalSupportMode = "\e[8h"
SetBracketedPasteMode = "\e[?2004h"
SetButtonEventMouseMode = "\e[?1002h"
SetCursorKeysMode = "\e[?1h"
SetFocusEventMode = "\e[?1004h"
SetGraphemeClusteringMode = "\e[?2027h"
SetHighlightMouseMode = "\e[?1001h"
SetInBandResizeMode = "\e[?2048h"
SetIndeterminateProgressBar = "\e]9;4;3\a"

SetIndeterminateProgressBar is a sequence that sets the progress bar to the indeterminate state.

OSC 9 ; 4 ; 3 BEL

See: https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences

SetInsertReplaceMode = "\e[4h"
SetKeyboardActionMode = "\e[2h"
SetLeftRightMarginMode = "\e[?69h"
SetLightDarkMode = "\e[?2031h"
SetLineFeedNewLineMode = "\e[20h"
SetLocalEchoMode = "\e[12h"
SetModeAltScreen = "\e[?1047h"
SetModeAltScreenSaveCursor = "\e[?1049h"
SetModeAutoWrap = "\e[?7h"
SetModeBackarrowKey = "\e[?67h"
SetModeBiDirectionalSupport = "\e[8h"
SetModeBracketedPaste = "\e[?2004h"
SetModeCursorKeys = "\e[?1h"
SetModeFocusEvent = "\e[?1004h"
SetModeInBandResize = "\e[?2048h"
SetModeInsertReplace = "\e[4h"
SetModeKeyboardAction = "\e[2h"
SetModeLeftRightMargin = "\e[?69h"
SetModeLightDark = "\e[?2031h"
SetModeLineFeedNewLine = "\e[20h"
SetModeLocalEcho = "\e[12h"
SetModeMouseAnyEvent = "\e[?1003h"
SetModeMouseButtonEvent = "\e[?1002h"
SetModeMouseExtSgr = "\e[?1006h"
SetModeMouseExtSgrPixel = "\e[?1016h"
SetModeMouseExtUrxvt = "\e[?1015h"
SetModeMouseExtUtf8 = "\e[?1005h"
SetModeMouseHighlight = "\e[?1001h"
SetModeMouseNormal = "\e[?1000h"
SetModeMouseX10 = "\e[?9h"
SetModeNumericKeypad = "\e[?66h"
SetModeOrigin = "\e[?6h"
SetModeSaveCursor = "\e[?1048h"
SetModeSendReceive = "\e[12h"
SetModeSynchronizedOutput = "\e[?2026h"
SetModeTextCursorEnable = "\e[?25h"
SetModeUnicodeCore = "\e[?2027h"
SetModeWin32Input = "\e[?9001h"
SetModifyOtherKeys1 = "\e[>4;1m"

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:modifyOtherKeys

SetModifyOtherKeys2 = "\e[>4;2m"
SetNormalMouseMode = "\e[?1000h"
SetNumericKeypadMode = "\e[?66h"
SetOriginMode = "\e[?6h"
SetSaveCursorMode = "\e[?1048h"
SetSendReceiveMode = "\e[12h"
SetSgrExtMouseMode = "\e[?1006h"
SetSgrPixelExtMouseMode = "\e[?1016h"
SetSynchronizedOutputMode = "\e[?2026h"
SetTabEvery8Columns = "\e[?5W"

SetTabEvery8Columns (DECST8C) sets the tab stops at every 8 columns.

CSI ? 5 W

See: https://vt100.net/docs/vt510-rm/DECST8C.html

SetTextCursorEnableMode = "\e[?25h"
SetUnicodeCoreMode = "\e[?2027h"
SetUrxvtExtMouseMode = "\e[?1015h"
SetUtf8ExtMouseMode = "\e[?1005h"
SetWin32InputMode = "\e[?9001h"
SetX10MouseMode = "\e[?9h"
SGCI = C1::SGCI
SgrExtMouseMode = DECMode.new(1006)

SGR Extended Mouse Mode changes the mouse tracking encoding to use SGR parameters.

Deprecated: use [ModeMouseExtSgr] instead.

SgrPixelExtMouseMode = DECMode.new(1016)

SGR Pixel Extended Mouse Mode changes the mouse tracking encoding to use SGR parameters with pixel coordinates.

Deprecated: use [ModeMouseExtSgrPixel] instead.

ShowCursor = SetModeTextCursorEnable
SI = C0::SI
SlowBlinkAttr = AttrBlink
SO = C0::SO
SOH = C0::SOH
SOS = C1::SOS
SP = ASCII::SP

Constants for easy access at module top level

SPA = C1::SPA
SRM = ModeSendReceive
SS2 = C1::SS2
SS3 = C1::SS3
SSA = C1::SSA
ST = C1::ST
StrikethroughAttr = AttrStrikethrough
StringState = 5_u8
STS = C1::STS
STX = C0::STX
SUB = C0::SUB
SYN = C0::SYN
SyncdOutputMode = DECMode.new(2026)

Synchronized output mode.

Deprecated: use [ModeSynchronizedOutput], [SetModeSynchronizedOutput], [ResetModeSynchronizedOutput], and [RequestModeSynchronizedOutput] instead.

SynchronizedOutputMode = DECMode.new(2026)

Synchronized Output Mode determines whether output is synchronized with the terminal.

Deprecated: use [ModeSynchronizedOutput] instead.

SystemClipboard = 'c'.ord.to_u8

Clipboard names.

TextCursorEnableMode = DECMode.new(25)

Text Cursor Enable Mode (DECTCEM) shows/hides the cursor.

Deprecated: use [ModeTextCursorEnable] instead.

UnderlineAttr = AttrUnderline
UnicodeCoreMode = DECMode.new(2027)

Unicode Core Mode determines whether the terminal uses Unicode grapheme clustering.

Deprecated: use [ModeUnicodeCore] instead.

UrxvtExtMouseMode = DECMode.new(1015)

URXVT Extended Mouse Mode changes the mouse tracking encoding to use an alternate encoding.

Deprecated: use [ModeMouseUrxvtExt] instead.

US = C0::US
Utf8ExtMouseMode = DECMode.new(1005)

UTF-8 Extended Mouse Mode changes the mouse tracking encoding to use UTF-8 parameters.

Deprecated: use [ModeMouseExtUtf8] instead.

VT = C0::VT
VTS = C1::VTS
WcWidth = Method::WcWidth
WhiteBackgroundColorAttr = AttrWhiteBackgroundColor
WhiteForegroundColorAttr = AttrWhiteForegroundColor
Win32InputMode = DECMode.new(9001)

Win32Input determines whether input is processed by the Win32 console and Conpty.

Deprecated: use [ModeWin32Input] instead.

X10MouseMode = DECMode.new(9)

X10 Mouse Mode determines whether the mouse reports on button presses.

Deprecated: use [ModeMouseX10] instead.

X10Offset = 32_u8
XTVERSION = RequestNameVersion
YellowBackgroundColorAttr = AttrYellowBackgroundColor
YellowForegroundColorAttr = AttrYellowForegroundColor

Class methods

ansi_to_rgb(ansi : UInt8) : Color

ansi_to_rgb converts an ANSI color to a 24-bit RGB color.

Source
byte_to_grapheme_range(str : String, byte_start : Int32, byte_stop : Int32) : Tuple(Int32, Int32)
Source
cbt(n : Int32) : String

CBT is an alias for [cursor_backward_tab].

Source
cha(col : Int32) : String

CHA is an alias for [cursor_horizontal_absolute].

Source
cht(n : Int32) : String

CHT is an alias for [cursor_horizontal_forward_tab].

Source
cmyk_to_rgb(c : UInt8, m : UInt8, y : UInt8, k : UInt8) : Tuple(UInt8, UInt8, UInt8)

cmyk_to_rgb converts CMYK color components (0-255) to RGB components (0-255). Implements the same conversion as Go's image/color.CMYKToRGB.

Source
cnl(n : Int32) : String

CNL is an alias for [cursor_next_line].

Source
color_to_hex_string(color : Color) : String

color_to_hex_string converts a color to a hex string.

Source
command(prefix : UInt8, inter : UInt8, final : UInt8) : Int32
Source
convert_16(color : BasicColor) : BasicColor

Convert16 converts a color to a 16-color ANSI color. It will first try to find a match in the 256 xterm(1) color palette, and then map that to the 16-color ANSI palette.

Source
convert_16(color : IndexedColor) : BasicColor
Source
convert_16(color : TrueColor) : BasicColor
Source
convert_16(color : Color) : BasicColor
Source
convert_16(color : Colorful::Color) : BasicColor
Source
convert_256(color : IndexedColor) : IndexedColor

Convert256 overloads for various color types

Source
convert_256(color : BasicColor) : IndexedColor
Source
convert_256(color : TrueColor) : IndexedColor
Source
convert_256(color : Color) : IndexedColor
Source
convert_256(color : RGBColor) : IndexedColor
Source
convert_256(color : HexColor) : IndexedColor
Source
convert_256(color : XRGBColor) : IndexedColor
Source
convert_256(color : XRGBAColor) : IndexedColor
Source
convert_256(color : Colorful::Color) : IndexedColor

Convert256 converts a color, usually a 24-bit color, to xterm(1) 256 color palette.

Source
cpl(n : Int32) : String

CPL is an alias for [cursor_previous_line].

Source
cpr(line : Int32, column : Int32) : String

CPR is an alias for [cursor_position_report].

Source
cub(n : Int32) : String

CUB is an alias for [cursor_backward].

Source
cud(n : Int32) : String

CUD is an alias for [cursor_down].

Source
cuf(n : Int32) : String

CUF is an alias for [cursor_forward].

Source
cup(col : Int32, row : Int32) : String

CUP is an alias for [cursor_position].

Source
cursor_backward(n : Int32) : String

CursorBackward (CUB) returns a sequence for moving the cursor left n cells.

CSI n D

See: https://vt100.net/docs/vt510-rm/CUB.html

Source
cursor_backward_tab(n : Int32) : String

CursorBackwardTab (CBT) returns a sequence for moving the cursor to the previous tab stop n times.

Default is 1.

CSI n Z

See: https://vt100.net/docs/vt510-rm/CBT.html

Source
cursor_down(n : Int32) : String

CursorDown (CUD) returns a sequence for moving the cursor down n cells.

CSI n B

See: https://vt100.net/docs/vt510-rm/CUD.html

Source
cursor_forward(n : Int32) : String

CursorForward (CUF) returns a sequence for moving the cursor right n cells.

CSI n C

See: https://vt100.net/docs/vt510-rm/CUF.html

Source
cursor_horizontal_absolute(col : Int32) : String

CursorHorizontalAbsolute (CHA) returns a sequence for moving the cursor to the given column.

Default is 1.

CSI n G

See: https://vt100.net/docs/vt510-rm/CHA.html

Source
cursor_horizontal_forward_tab(n : Int32) : String

CursorHorizontalForwardTab (CHT) returns a sequence for moving the cursor to the next tab stop n times.

Default is 1.

CSI n I

See: https://vt100.net/docs/vt510-rm/CHT.html

Source
cursor_information_report(*values : Int32) : String

CursorInformationReport (DECCIR) is the response to a cursor information report request. It reports the cursor position, visual attributes, and character protection attributes. It also reports the status of origin mode [DECOM] and the current active character set.

The response is a list of values separated by a semicolon (;) character.

DCS 1 $ u D ... D ST

Where D is a decimal number representing a value.

See: https://vt100.net/docs/vt510-rm/DECCIR.html

Source
cursor_left(n : Int32) : String

CursorLeft (CUB) returns a sequence for moving the cursor left n cells.

CSI n D

See: https://vt100.net/docs/vt510-rm/CUB.html

Deprecated: use [cursor_backward] instead.

Source
cursor_next_line(n : Int32) : String

CursorNextLine (CNL) returns a sequence for moving the cursor to the beginning of the next line n times.

CSI n E

See: https://vt100.net/docs/vt510-rm/CNL.html

Source
cursor_position(col : Int32, row : Int32) : String

CursorPosition (CUP) returns a sequence for setting the cursor to the given row and column.

Default is 1,1.

CSI n ; m H

See: https://vt100.net/docs/vt510-rm/CUP.html

Source
cursor_position_report(line : Int32, column : Int32) : String

CursorPositionReport (CPR) is a control sequence that reports the cursor's position.

CSI Pl ; Pc R

Where Pl is the line number and Pc is the column number.

See also https://vt100.net/docs/vt510-rm/CPR.html

Source
cursor_previous_line(n : Int32) : String

CursorPreviousLine (CPL) returns a sequence for moving the cursor to the beginning of the previous line n times.

CSI n F

See: https://vt100.net/docs/vt510-rm/CPL.html

Source
cursor_right(n : Int32) : String

CursorRight (CUF) returns a sequence for moving the cursor right n cells.

CSI n C

See: https://vt100.net/docs/vt510-rm/CUF.html

Deprecated: use [cursor_forward] instead.

Source
cursor_up(n : Int32) : String

CursorUp (CUU) returns a sequence for moving the cursor up n cells.

CSI n A

See: https://vt100.net/docs/vt510-rm/CUU.html

Source
cut(m : Method, s : String, left : Int32, right : Int32) : String
Source
cut(s : String, left : Int32, right : Int32) : String
Source
cut_wc(s : String, left : Int32, right : Int32) : String
Source
cuu(n : Int32) : String

CUU is an alias for [cursor_up].

Source
da1(*attrs) : String

DA1 is an alias for [primary_device_attributes].

Source
da2(*attrs) : String

DA2 is an alias for [secondary_device_attributes].

Source
da3(unit_id : String) : String

DA3 is an alias for [tertiary_device_attributes].

Source
dch(n : Int32) : String

DCH is an alias for [delete_character].

Source
deccir(*values : Int32) : String

DECCIR is an alias for [cursor_information_report].

Source
decode_sequence(b : Bytes, state : UInt8, p : Parser | Nil = nil)
Source
decode_sequence(b : String, state : UInt8, p : Parser | Nil = nil)
Source
decode_sequence_wc(b : Bytes, state : UInt8, p : Parser | Nil = nil)
Source
decode_sequence_wc(b : String, state : UInt8, p : Parser | Nil = nil)
Source
decrpm(mode : Mode, value : ModeSetting) : String
Source
decrqm(mode : Mode) : String
Source
decrqpsr(n : Int32) : String

DECRQPSR is an alias for [request_presentation_state_report].

Source
decrst(*modes : Mode) : String
Source
decscusr(style : Int32) : String

DECSCUSR is an alias for [set_cursor_style].

Source
decset(*modes : Mode) : String
Source
decsin(name : String) : String

DECSIN is a sequence for setting the icon name.

This is an alias for SetWindowTitle("L;<name>"). See: EK-VT520-RM 5–134 https://vt100.net/dec/ek-vt520-rm.pdf

Source
decslrm(left : Int32, right : Int32) : String

DECSLRM is an alias for [set_left_right_margins].

Source
decstbm(top : Int32, bot : Int32) : String

DECSTBM is an alias for [set_top_bottom_margins].

Source
decswt(name : String) : String

DECSWT is a sequence for setting the window title.

This is an alias for SetWindowTitle("1;<name>"). See: EK-VT520-RM 5–156 https://vt100.net/dec/ek-vt520-rm.pdf

Source
dectabsr(*stops : Int32) : String

DECTABSR is an alias for [tab_stop_report].

Source
decxcpr(line : Int32, column : Int32, page : Int32) : String

DECXCPR is an alias for [extended_cursor_position_report].

Source
delete_character(n : Int32) : String

DeleteCharacter (DCH) deletes n characters at the current cursor position. As the characters are deleted, the remaining characters move to the left and the cursor remains at the same position.

Default is 1.

CSI Pn P

See: https://vt100.net/docs/vt510-rm/DCH.html

Source
delete_line(n : Int32) : String

DeleteLine (DL) deletes n lines at the current cursor position. Existing lines are moved up.

CSI Pn M

See: https://vt100.net/docs/vt510-rm/DL.html

Source
desktop_notification(payload : String, *metadata) : String

DesktopNotification sends a desktop notification based on the extensible OSC 99 escape code.

OSC 99 ; <metadata> ; <payload> ST
OSC 99 ; <metadata> ; <payload> BEL

Where <metadata> is a colon-separated list of key-value pairs, and <payload> is the notification body.

See: https://sw.kovidgoyal.net/kitty/desktop-notifications/

Source
device_status_report(*statuses : StatusReport) : String

DeviceStatusReport (DSR) is a control sequence that reports the terminal's status. The terminal responds with a DSR sequence.

CSI Ps n
CSI ? Ps n

If one of the statuses is a [DECStatusReport], the sequence will use the DEC format.

See also https://vt100.net/docs/vt510-rm/DSR.html

Source
dist_sq(r1 : Int32, g1 : Int32, b1 : Int32, r2 : Int32, g2 : Int32, b2 : Int32) : Int32

dist_sq calculates the squared distance between two colors.

Source
dl(n : Int32) : String

DL is an alias for [delete_line].

Source
dsr(status : StatusReport) : String

DSR is an alias for [device_status_report].

Source
ech(n : Int32) : String

ECH is an alias for [erase_character].

Source
ed(n : Int32) : String

ED is an alias for [erase_display].

Source
el(n : Int32) : String

EL is an alias for [erase_line].

Source
encode_mouse_button(b : MouseButton, motion : Bool, shift : Bool, alt : Bool, ctrl : Bool) : UInt8
Source
equal?(a : Bytes, b : Bytes) : Bool
Source
equal?(a : String, b : String) : Bool
Source
erase_character(n : Int32) : String

EraseCharacter (ECH) returns a sequence for erasing n characters from the screen. This doesn't affect other cell attributes.

Default is 1.

CSI n X

See: https://vt100.net/docs/vt510-rm/ECH.html

Source
erase_display(n : Int32) : String

EraseDisplay (ED) clears the display or parts of the display. A screen is the shown part of the terminal display excluding the scrollback buffer. Possible values:

Default is 0.

 0: Clear from cursor to end of screen.
 1: Clear from cursor to beginning of the screen.
 2: Clear entire screen (and moves cursor to upper left on DOS).
 3: Clear entire display which delete all lines saved in the scrollback buffer (xterm).

CSI <n> J

See: https://vt100.net/docs/vt510-rm/ED.html

Source
erase_line(n : Int32) : String

EraseLine (EL) clears the current line or parts of the line. Possible values:

0: Clear from cursor to end of line.
1: Clear from cursor to beginning of the line.
2: Clear entire line.

The cursor position is not affected.

CSI <n> K

See: https://vt100.net/docs/vt510-rm/EL.html

Source
execute(io : IO, s : String) : Int32

Execute writes the given escape sequence to the provided output.

This is a syntactic sugar over IO#write.

Source
extended_cursor_position_report(line : Int32, column : Int32, page : Int32) : String

ExtendedCursorPositionReport (DECXCPR) is a control sequence that reports the cursor's position along with the page number (optional).

CSI ? Pl ; Pc R
CSI ? Pl ; Pc ; Pv R

Where Pl is the line number, Pc is the column number, and Pv is the page number.

If the page number is zero or negative, the returned sequence won't include the page number.

See also https://vt100.net/docs/vt510-rm/DECXCPR.html

Source
final_term(*pm : String) : String

FinalTerm returns an escape sequence that is used for shell integrations. Originally, FinalTerm designed the protocol hence the name.

OSC 133 ; Ps ; Pm ST
OSC 133 ; Ps ; Pm BEL

See: https://iterm2.com/documentation-shell-integration.html

Source
final_term_cmd_executed(*pm : String) : String

FinalTermCmdExecuted returns an escape sequence that is used for shell integrations command executed marks. This is sent just before the start of the command output.

This is an alias for FinalTerm("C").

Source
final_term_cmd_finished(*pm : String) : String

FinalTermCmdFinished returns an escape sequence that is used for shell integrations command finished marks.

If the command was sent after [FinalTermCmdStart], it indicates that the command was aborted. If the command was sent after [FinalTermCmdExecuted], it indicates the end of the command output. If neither was sent, [FinalTermCmdFinished] should be ignored.

This is an alias for FinalTerm("D").

Source
final_term_cmd_start(*pm : String) : String

FinalTermCmdStart returns an escape sequence that is used for shell integrations command start marks. This is sent just after the end of the shell prompt, before the user enters a command.

This is an alias for FinalTerm("B").

Source
final_term_prompt(*pm : String) : String

FinalTermPrompt returns an escape sequence that is used for shell integrations prompt marks. This is sent just before the start of the shell prompt.

This is an alias for FinalTerm("A").

Source
get_parser

ameba:disable Naming/AccessorMethodName

Source
hardwrap(m : Method, s : String, limit : Int32, preserve_space : Bool) : String

ameba:disable Metrics/CyclomaticComplexity

Source
hardwrap(s : String, limit : Int32, preserve_space : Bool) : String
Source
hardwrap_wc(s : String, limit : Int32, preserve_space : Bool) : String
Source
has_apc_prefix?(b : Bytes) : Bool
Source
has_apc_prefix?(b : String) : Bool
Source
has_csi_prefix?(b : Bytes) : Bool
Source
has_csi_prefix?(b : String) : Bool
Source
has_dcs_prefix?(b : Bytes) : Bool
Source
has_dcs_prefix?(b : String) : Bool
Source
has_esc_prefix?(b : Bytes) : Bool
Source
has_esc_prefix?(b : String) : Bool
Source
has_osc_prefix?(b : Bytes) : Bool
Source
has_osc_prefix?(b : String) : Bool
Source
has_pm_prefix?(b : Bytes) : Bool
Source
has_pm_prefix?(b : String) : Bool
Source
has_prefix?(b : Bytes, prefix : Bytes) : Bool
Source
has_prefix?(b : String, prefix : String) : Bool
Source
has_sos_prefix?(b : Bytes) : Bool
Source
has_sos_prefix?(b : String) : Bool
Source
has_st_prefix?(b : Bytes) : Bool
Source
has_st_prefix?(b : String) : Bool
Source
has_suffix?(b : Bytes, suffix : Bytes) : Bool
Source
has_suffix?(b : String, suffix : String) : Bool
Source
hex_to_rgb(hex : UInt32) : Tuple(UInt8, UInt8, UInt8)

hex_to_rgb converts a number in hexadecimal format to red, green, and blue values.

Source
horizontal_position_absolute(col : Int32) : String

HorizontalPositionAbsolute (HPA) returns a sequence for moving the cursor to the given column. This has the same effect as [CUP].

Default is 1.

CSI n `

See: https://vt100.net/docs/vt510-rm/HPA.html

Source
horizontal_position_relative(n : Int32) : String

HorizontalPositionRelative (HPR) returns a sequence for moving the cursor right n columns relative to the current position. This has the same effect as [CUP].

Default is 1.

CSI n a

See: https://vt100.net/docs/vt510-rm/HPR.html

Source
horizontal_vertical_position(col : Int32, row : Int32) : String

HorizontalVerticalPosition (HVP) returns a sequence for moving the cursor to the given row and column.

Default is 1,1.

CSI n ; m f

This has the same effect as [cursor_position].

See: https://vt100.net/docs/vt510-rm/HVP.html

Source
hpa(col : Int32) : String

HPA is an alias for [horizontal_position_absolute].

Source
hpr(n : Int32) : String

HPR is an alias for [horizontal_position_relative].

Source
hvp(col : Int32, row : Int32) : String

HVP is an alias for [horizontal_vertical_position].

Source
ich(n : Int32) : String

ICH is an alias for [insert_character].

Source
il(n : Int32) : String

IL is an alias for [insert_line].

Source
in_band_resize(height_cells : Int32, width_cells : Int32, height_pixels : Int32, width_pixels : Int32) : String

InBandResize encodes an in-band terminal resize event sequence.

CSI 48 ; height_cells ; widht_cells ; height_pixels ; width_pixels t

See https://gist.github.com/rockorager/e695fb2924d36b2bcf1fff4a3704bd83

Source
insert_character(n : Int32) : String

InsertCharacter (ICH) inserts n blank characters at the current cursor position. Existing characters move to the right. Characters moved past the right margin are lost. ICH has no effect outside the scrolling margins.

Default is 1.

CSI Pn @

See: https://vt100.net/docs/vt510-rm/ICH.html

Source
insert_line(n : Int32) : String

InsertLine (IL) inserts n blank lines at the current cursor position. Existing lines are moved down.

CSI Pn L

See: https://vt100.net/docs/vt510-rm/IL.html

Source
iterm2(data : String) : String
Source
key_modifier_options(p : Int32, *vs : Int32) : String

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

Source
kitty_graphics(payload : Bytes, opts : Array(String) = [] of String) : String
Source
kitty_keyboard(flags : Int32, mode : Int32) : String

KittyKeyboard returns a sequence to request keyboard enhancements from the terminal. The flags argument is a bitmask of the Kitty keyboard protocol flags. While mode specifies how the flags should be interpreted.

Possible values for flags mask:

1:  Disambiguate escape codes
2:  Report event types
4:  Report alternate keys
8:  Report all keys as escape codes
16: Report associated text

Possible values for mode:

1: Set given flags and unset all others
2: Set given flags and keep existing flags unchanged
3: Unset given flags and keep existing flags unchanged

See https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement

Source
light_dark_report(dark : Bool) : String

LightDarkReport is a control sequence that reports the terminal's operating system light/dark color preference.

CSI ? 997 ; 1 n   for dark mode
CSI ? 997 ; 2 n   for light mode

See: https://contour-terminal.org/vt-extensions/color-palette-update-notifications/

Source
modify_other_keys(mode : Int32) : String

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.

Source
mouse_sgr(b : UInt8, x : Int32, y : Int32, release : Bool) : String
Source
mouse_x10(b : UInt8, x : Int32, y : Int32) : String
Source
move_cursor(col : Int32, row : Int32) : String

MoveCursor (CUP) returns a sequence for setting the cursor to the given row and column.

CSI n ; m H

See: https://vt100.net/docs/vt510-rm/CUP.html

Deprecated: use [cursor_position] instead.

Source
nearest_color(color : Color, palette : Array(Color)) : Color

nearest_color finds the nearest color in the palette to the given color.

Source
nearest_color_index(color : Color, palette : Array(Color)) : Int32

nearest_color_index finds the index of the nearest color in the palette to the given color.

Source
notify(s : String) : String

Notify sends a desktop notification using iTerm's OSC 9.

OSC 9 ; Mc ST
OSC 9 ; Mc BEL

Where Mc is the notification body.

See: https://iterm2.com/documentation-escape-codes.html

Source
notify_working_directory(host : String, *paths : String) : String

NotifyWorkingDirectory returns a sequence that notifies the terminal of the current working directory.

OSC 7 ; Pt BEL

Where Pt is a URL in the format "file://[host]/[path]". Set host to "localhost" if this is a path on the local computer.

See: https://wezfurlong.org/wezterm/shell-integration.html#osc-7-escape-sequence-to-set-the-working-directory See: https://iterm2.com/documentation-escape-codes.html#:~:text=RemoteHost%20and%20CurrentDir%3A-,OSC%207,-%3B%20%5BPs%5D%20ST

Source
pan_down(n : Int32) : String

PanDown is an alias for [scroll_up].

Source
pan_up(n : Int32) : String

PanUp is an alias for [scroll_down].

Source
parameter(p : Int32, has_more : Bool) : Int32
Source
pop_kitty_keyboard(n : Int32) : String

PopKittyKeyboard returns a sequence to pop n number of flags from the terminal Kitty Keyboard stack.

CSI < flags u

See https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement

Source
primary_device_attributes(*attrs) : String

PrimaryDeviceAttributes (DA1) is a control sequence that reports the terminal's primary device attributes.

CSI c
CSI 0 c
CSI ? Ps ; ... c

If no attributes are given, or if the attribute is 0, this function returns the request sequence. Otherwise, it returns the response sequence.

Common attributes include:

  • 1 132 columns
  • 2 Printer port
  • 4 Sixel
  • 6 Selective erase
  • 7 Soft character set (DRCS)
  • 8 User-defined keys (UDKs)
  • 9 National replacement character sets (NRCS) (International terminal only)
  • 12 Yugoslavian (SCS)
  • 15 Technical character set
  • 18 Windowing capability
  • 21 Horizontal scrolling
  • 23 Greek
  • 24 Turkish
  • 42 ISO Latin-2 character set
  • 44 PCTerm
  • 45 Soft key map
  • 46 ASCII emulation

See https://vt100.net/docs/vt510-rm/DA1.html

Source
push_kitty_keyboard(flags : Int32) : String

PushKittyKeyboard returns a sequence to push the given flags to the terminal Kitty Keyboard stack.

Possible values for flags mask:

0:  Disable all features
1:  Disambiguate escape codes
2:  Report event types
4:  Report alternate keys
8:  Report all keys as escape codes
16: Report associated text

CSI > flags u

See https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement

Source
put_parser(p : Parser)
Source
query_key_modifier_options(pp : Int32) : String

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

Source
read_style_color(params : Params) : Tuple(Int32, PaletteColor | Nil)

ReadStyleColor decodes a color from a slice of parameters. It returns the number of parameters read and the color. This function is used to read SGR color parameters following the ITU T.416 standard.

It supports reading the following color types:

  • 0: implementation defined
  • 1: transparent
  • 2: RGB direct color
  • 3: CMY direct color
  • 4: CMYK direct color
  • 5: indexed color
  • 6: RGBA direct color (WezTerm extension)

The parameters can be separated by semicolons (;) or colons (:). Mixing separators is not allowed. ameba:disable Metrics/CyclomaticComplexity

Source
rep(n : Int32) : String

REP is an alias for [repeat_previous_character].

Source
repeat_previous_character(n : Int32) : String

RepeatPreviousCharacter (REP) repeats the previous character n times. This is identical to typing the same character n times.

Default is 1.

CSI Pn b

See: ECMA-48 § 8.3.103.

Source
report_mode(mode : Mode, value : ModeSetting) : String
Source
report_mode(mode : Mode, value : Int32) : String
Source
request_clipboard(c : UInt8) : String

RequestClipboard returns a sequence for requesting the clipboard.

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands

Source
request_clipboard(c : Char) : String
Source
request_mode(mode : Mode) : String
Source
request_presentation_state_report(n : Int32) : String

RequestPresentationStateReport (DECRQPSR) requests the terminal to send a report of the presentation state. This includes the cursor information [DECCIR], and tab stop [DECTABSR] reports.

Default is 0.

Possible values: 0: Error, request ignored. 1: Cursor information report [DECCIR]. 2: Tab stop report [DECTABSR].

CSI Ps $ w

See: https://vt100.net/docs/vt510-rm/DECRQPSR.html

Source
request_termcap(*caps : String) : String

RequestTermcap is an alias for [xtgettcap].

Source
request_terminfo(*caps : String) : String

RequestTerminfo is an alias for [xtgettcap].

Source
reset_clipboard(c : UInt8) : String

ResetClipboard returns a sequence for resetting the clipboard.

This is equivalent to SetClipboard(c, "").

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands

Source
reset_clipboard(c : Char) : String
Source
reset_key_modifier_options(pp : Int32) : String

ResetKeyModifierOptions resets xterm key modifier options. This is an alias for [key_modifier_options].

Source
reset_mode
Source
reset_mode(*modes : Mode) : String
Source
rm(*modes : Mode) : String
Source
screen_passthrough(seq : String, limit : Int32) : String

ScreenPassthrough wraps the given ANSI sequence in a DCS passthrough sequence to be sent to the outer terminal. This is used to send raw escape sequences to the outer terminal when running inside GNU Screen.

DCS <data> ST

Note: Screen limits the length of string sequences to 768 bytes (since 2014). Use zero to indicate no limit, otherwise, this will chunk the returned string into limit sized chunks.

See: https://www.gnu.org/software/screen/manual/screen.html#String-Escapes See: https://git.savannah.gnu.org/cgit/screen.git/tree/src/screen.h?id=c184c6ec27683ff1a860c45be5cf520d896fd2ef#n44

Source
scroll_down(n : Int32) : String

ScrollDown (SD) scrolls the screen down n lines. New lines are added at the top of the screen.

CSI Pn T

See: https://vt100.net/docs/vt510-rm/SD.html

Source
scroll_up(n : Int32) : String

ScrollUp (SU) scrolls the screen up n lines. New lines are added at the bottom of the screen.

CSI Pn S

See: https://vt100.net/docs/vt510-rm/SU.html

Source
scs(gset : Char, charset : Char) : String

SCS is an alias for SelectCharacterSet.

Source
sd(n : Int32) : String

SD is an alias for [scroll_down].

Source
secondary_device_attributes(*attrs) : String

SecondaryDeviceAttributes (DA2) is a control sequence that reports the terminal's secondary device attributes.

CSI > c
CSI > 0 c
CSI > Ps ; ... c

See https://vt100.net/docs/vt510-rm/DA2.html

Source
select_character_set(gset : Char, charset : Char) : String

SelectCharacterSet sets the G-set character designator to the specified character set.

ESC Ps Pd

Where Ps is the G-set character designator, and Pd is the identifier. For 94-character sets, the designator can be one of:

  • ( G0
  • ) G1
    • G2
    • G3

For 96-character sets, the designator can be one of:

    • G1
  • . G2
  • / G3

Some common 94-character sets are:

  • 0 DEC Special Drawing Set
  • A United Kingdom (UK)
  • B United States (USASCII)

Examples:

ESC ( B  Select character set G0 = United States (USASCII)
ESC ( 0  Select character set G0 = Special Character and Line Drawing Set
ESC ) 0  Select character set G1 = Special Character and Line Drawing Set
ESC * A  Select character set G2 = United Kingdom (UK)

See: https://vt100.net/docs/vt510-rm/SCS.html

Source
select_graphic_rendition(attrs : Array(Attr)) : String

SelectGraphicRendition (SGR) is a command that sets display attributes.

Default is 0.

CSI Ps ; Ps ... m

See: https://vt100.net/docs/vt510-rm/SGR.html

Source
select_graphic_rendition(*attrs : Attr) : String
Source
set_background_color(s : String) : String

SetBackgroundColor returns a sequence that sets the default terminal background color.

OSC 11 ; color ST
OSC 11 ; color BEL

Where color is the encoded color number. Most terminals support hex, XParseColor rgb: and rgba: strings.

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands ameba:disable Naming/AccessorMethodName

Source
set_clipboard(c : UInt8, d : String) : String

SetClipboard returns a sequence for manipulating the clipboard.

OSC 52 ; Pc ; Pd ST
OSC 52 ; Pc ; Pd BEL

Where Pc is the clipboard name and Pd is the base64 encoded data. Empty data or invalid base64 data will reset the clipboard.

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands

Source
set_clipboard(c : Char, d : String) : String
Source
set_cursor_color(s : String) : String

SetCursorColor returns a sequence that sets the terminal cursor color.

OSC 12 ; color ST
OSC 12 ; color BEL

Where color is the encoded color number. Most terminals support hex, XParseColor rgb: and rgba: strings.

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands ameba:disable Naming/AccessorMethodName

Source
set_cursor_position(col : Int32, row : Int32) : String

SetCursorPosition (CUP) returns a sequence for setting the cursor to the given row and column.

CSI n ; m H

See: https://vt100.net/docs/vt510-rm/CUP.html

Deprecated: use [cursor_position] instead.

Source
set_cursor_style(style : Int32) : String

SetCursorStyle (DECSCUSR) returns a sequence for changing the cursor style.

Default is 1.

CSI Ps SP q

Where Ps is the cursor style:

0: Blinking block
1: Blinking block (default)
2: Steady block
3: Blinking underline
4: Steady underline
5: Blinking bar (xterm)
6: Steady bar (xterm)

See: https://vt100.net/docs/vt510-rm/DECSCUSR.html See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-SP-q.1D81 ameba:disable Naming/AccessorMethodName

Source
set_error_progress_bar(percentage : Int32) : String

SetErrorProgressBar returns a sequence for setting the progress bar to a specific percentage (0-100) in the "Error" state.

OSC 9 ; 4 ; 2 Percentage BEL

See: https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences ameba:disable Naming/AccessorMethodName

Source
set_foreground_color(s : String) : String

SetForegroundColor returns a sequence that sets the default terminal foreground color.

OSC 10 ; color ST
OSC 10 ; color BEL

Where color is the encoded color number. Most terminals support hex, XParseColor rgb: and rgba: strings.

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands ameba:disable Naming/AccessorMethodName

Source
set_icon_name(s : String) : String

SetIconName returns a sequence for setting the icon name.

OSC 1 ; title ST
OSC 1 ; title BEL

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands ameba:disable Naming/AccessorMethodName

Source
set_icon_name_window_title(s : String) : String

SetIconNameWindowTitle returns a sequence for setting the icon name and window title.

OSC 0 ; title ST
OSC 0 ; title BEL

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands ameba:disable Naming/AccessorMethodName

Source
set_key_modifier_options(pp : Int32, pv : Int32) : String

SetKeyModifierOptions sets xterm key modifier options. This is an alias for [key_modifier_options].

Source
set_left_right_margins(left : Int32, right : Int32) : String

SetLeftRightMargins (DECSLRM) sets the left and right margins for the scrolling region.

Default is 1 and the right of the screen.

CSI Pl ; Pr s

See: https://vt100.net/docs/vt510-rm/DECSLRM.html

Source
set_mode
Source
set_mode(*modes : Mode) : String

ameba:disable Naming/AccessorMethodName

Source
set_palette(index : Int32, color : Ansi::PaletteColor | Nil = nil) : String

SetPalette sets the palette color for the given index. The index is a 16 color index between 0 and 15. The color is a 24-bit RGB color.

OSC P n rrggbb BEL

Where n is the color index in hex (0-f), and rrggbb is the color in hexadecimal format (e.g., ff0000 for red).

This sequence is specific to the Linux Console and may not work in other terminal emulators.

See https://man7.org/linux/man-pages/man4/console_codes.4.html

Source
set_pointer_shape(shape : String) : String

SetPointerShape returns a sequence for changing the mouse pointer cursor shape. Use "default" for the default pointer shape.

OSC 22 ; Pt ST
OSC 22 ; Pt BEL

Where Pt is the pointer shape name. The name can be anything that the operating system can understand. Some common names are:

  • copy
  • crosshair
  • default
  • ew-resize
  • n-resize
  • text
  • wait

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands ameba:disable Naming/AccessorMethodName

Source
set_primary_clipboard(d : String) : String

SetPrimaryClipboard returns a sequence for setting the primary clipboard.

This is equivalent to SetClipboard(PrimaryClipboard, d). ameba:disable Naming/AccessorMethodName

Source
set_progress_bar(percentage : Int32) : String

SetProgressBar returns a sequence for setting the progress bar to a specific percentage (0-100) in the "default" state.

OSC 9 ; 4 ; 1 Percentage BEL

See: https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences ameba:disable Naming/AccessorMethodName

Source
set_scrolling_region(t : Int32, b : Int32) : String

SetScrollingRegion (DECSTBM) sets the top and bottom margins for the scrolling region. The default is the entire screen.

CSI <top> ; <bottom> r

See: https://vt100.net/docs/vt510-rm/DECSTBM.html

Deprecated: use [set_top_bottom_margins] instead.

Source
set_system_clipboard(d : String) : String

SetSystemClipboard returns a sequence for setting the system clipboard.

This is equivalent to SetClipboard(SystemClipboard, d). ameba:disable Naming/AccessorMethodName

Source
set_top_bottom_margins(top : Int32, bot : Int32) : String

SetTopBottomMargins (DECSTBM) sets the top and bottom margins for the scrolling region. The default is the entire screen.

Default is 1 and the bottom of the screen.

CSI Pt ; Pb r

See: https://vt100.net/docs/vt510-rm/DECSTBM.html

Source
set_warning_progress_bar(percentage : Int32) : String

SetWarningProgressBar is a sequence that sets the progress bar to the "Warning" state.

OSC 9 ; 4 ; 4 Percentage BEL

See: https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences ameba:disable Naming/AccessorMethodName

Source
set_window_title(s : String) : String

SetWindowTitle returns a sequence for setting the window title.

OSC 2 ; title ST
OSC 2 ; title BEL

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands ameba:disable Naming/AccessorMethodName

Source
sgr(attrs : Array(Attr)) : String

SGR is an alias for select_graphic_rendition.

Source
sgr(*attrs : Attr) : String
Source
sixel_graphics(p1 : Int32, p2 : Int32, p3 : Int32, payload : Bytes) : String
Source
sm(*modes : Mode) : String
Source
string_width(m : Method, s : String) : Int32
Source
string_width(s : String) : Int32
Source
string_width_wc(s : String) : Int32
Source
strip(s : String) : String
Source
su(n : Int32) : String

SU is an alias for [scroll_up].

Source
tab_clear(n : Int32) : String

TabClear (TBC) clears tab stops.

Default is 0.

Possible values: 0: Clear tab stop at the current column. (default) 3: Clear all tab stops.

CSI Pn g

See: https://vt100.net/docs/vt510-rm/TBC.html

Source
tab_stop_report(*stops : Int32) : String

TabStopReport (DECTABSR) is the response to a tab stop report request. It reports the tab stops set in the terminal.

The response is a list of tab stops separated by a slash (/) character.

DCS 2 $ u D ... D ST

Where D is a decimal number representing a tab stop.

See: https://vt100.net/docs/vt510-rm/DECTABSR.html

Source
tbc(n : Int32) : String

TBC is an alias for [tab_clear].

Source
tertiary_device_attributes(unit_id : String) : String

TertiaryDeviceAttributes (DA3) is a control sequence that reports the terminal's tertiary device attributes.

CSI = c
CSI = 0 c
DCS ! | Text ST

Where Text is the unit ID for the terminal.

If no unit ID is given, or if the unit ID is 0, this function returns the request sequence. Otherwise, it returns the response sequence.

See https://vt100.net/docs/vt510-rm/DA3.html

Source
tmux_passthrough(seq : String) : String

TmuxPassthrough wraps the given ANSI sequence in a special DCS passthrough sequence to be sent to the outer terminal. This is used to send raw escape sequences to the outer terminal when running inside Tmux.

DCS tmux ; <escaped-data> ST

Where <escaped-data> is the given sequence in which all occurrences of ESC (0x1b) are doubled i.e. replaced with ESC ESC (0x1b 0x1b).

Note: this needs the allow-passthrough option to be set to on.

See: https://github.com/tmux/tmux/wiki/FAQ#what-is-the-passthrough-escape-sequence-and-how-do-i-use-it

Source
to_params(params : Array(Int32)) : Params
Source
truncate(m : Method, s : String, length : Int32, tail : String) : String

ameba:disable Metrics/CyclomaticComplexity

Source
truncate(s : String, length : Int32, tail : String) : String
Source
truncate_left(m : Method, s : String, n : Int32, prefix : String) : String

ameba:disable Metrics/CyclomaticComplexity

Source
truncate_left(s : String, n : Int32, prefix : String) : String
Source
truncate_left_wc(s : String, n : Int32, prefix : String) : String
Source
truncate_wc(s : String, length : Int32, tail : String) : String
Source
urxvt_ext(extension : String, params : Array(String)) : String
Source
urxvt_ext(extension : String, *params : String) : String
Source
vertical_position_absolute(row : Int32) : String

VerticalPositionAbsolute (VPA) returns a sequence for moving the cursor to the given row.

Default is 1.

CSI n d

See: https://vt100.net/docs/vt510-rm/VPA.html

Source
vertical_position_relative(n : Int32) : String

VerticalPositionRelative (VPR) returns a sequence for moving the cursor down n rows relative to the current position.

Default is 1.

CSI n e

See: https://vt100.net/docs/vt510-rm/VPR.html

Source
vpa(row : Int32) : String

VPA is an alias for [vertical_position_absolute].

Source
vpr(n : Int32) : String

VPR is an alias for [vertical_position_relative].

Source
window_op(p : Int32, *ps : Int32) : String

WindowOp (XTWINOPS) is a sequence that manipulates the terminal window.

CSI Ps ; Ps ; Ps t

Ps is a semicolon-separated list of parameters. See https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps;Ps;Ps-t.1EB0

Source
wordwrap(m : Method, s : String, limit : Int32, breakpoints : String) : String

ameba:disable Metrics/CyclomaticComplexity

Source
wordwrap(s : String, limit : Int32, breakpoints : String) : String
Source
wordwrap_wc(s : String, limit : Int32, breakpoints : String) : String
Source
wrap(m : Method, s : String, limit : Int32, breakpoints : String) : String

ameba:disable Metrics/CyclomaticComplexity

Source
wrap(s : String, limit : Int32, breakpoints : String) : String
Source
wrap_wc(s : String, limit : Int32, breakpoints : String) : String
Source
x_parse_color(s : String) : Color | Nil

x_parse_color parses XParseColor-compatible strings into a Color. Supports:

  • #RGB
  • #RRGGBB
  • rgb:RRRR/GGGG/BBBB
  • rgba:RRRR/GGGG/BBBB/AAAA

Returns nil for invalid input.

Source
xtgettcap(*caps : String) : String

XTGETTCAP (RequestTermcap) requests Termcap/Terminfo strings.

DCS + q <Pt> ST

Where <Pt> is a list of Termcap/Terminfo capabilities, encoded in 2-digit hexadecimals, separated by semicolons.

See: https://man7.org/linux/man-pages/man5/terminfo.5.html See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands

Source
xtmodkeys(p : Int32, *vs : Int32) : String

XTMODKEYS is an alias for [key_modifier_options].

Source
xtqmodkeys(pp : Int32) : String

XTQMODKEYS is an alias for [query_key_modifier_options].

Source
xtwinops(p : Int32, *ps : Int32) : String

XTWINOPS is an alias for [window_op].

Source

Nested types