Class EscSeqUtils | Terminal.Gui v2 (original) (raw)
Namespace
Assembly
Terminal.Gui.dll
Provides a platform-independent API for managing ANSI escape sequences.
public static class EscSeqUtils
Inheritance
EscSeqUtils
Inherited Members
Fields
ESC [ - The CSI (Control Sequence Introducer).
CSI_ActivateAltBufferNoBackscroll
ESC [ ? 1047 h - Activate xterm alternative buffer (no backscroll)
ESC [ ? 1003 l - Disable any mouse event tracking.
Control sequence for disabling mouse events.
ESC [ ? 1006 l - Disable SGR (Select Graphic Rendition).
ESC [ ? 1015 l - Disable URXVT (Unicode Extended Virtual Terminal).
ESC [ ? 1003 h - Enable mouse event tracking.
Control sequence for enabling mouse events.
ESC [ ? 1006 h - Enable SGR (Select Graphic Rendition).
ESC [ ? 1015 h - Enable URXVT (Unicode Extended Virtual Terminal).
ESC [ ? 25 l - DECTCEM Text Cursor Enable Mode Hide Hide the cursor
CSI 1 8 t | yes | yes | yes | report window size in charshttps://terminalguide.namepad.de/seq/csi_st-18/The terminator indicating a reply to CSI_ReportTerminalSizeInChars : ESC [ 8 ; height ; width t
CSI_ReportTerminalSizeInChars_ResponseValue
The value of the response to CSI_ReportTerminalSizeInChars indicating value 1 and 2 are the terminal size in chars.
CSI_ReportTerminalSizeInChars_Terminator
The terminator indicating a reply to CSI_ReportTerminalSizeInChars : ESC [ 8 ; height ; width t
CSI_RequestCursorPositionReport
ESC [ ? 6 n - Request Cursor Position Report (?) (DECXCPR) https://terminalguide.namepad.de/seq/csi\_sn\_\_p-6/ The terminal reply to CSI_RequestCursorPositionReport. ESC [ ? (y) ; (x) ; 1 R
CSI_RequestCursorPositionReport_Terminator
The terminal reply to CSI_RequestCursorPositionReport. ESC [ ? (y) ; (x) R
CSI 16 t - Request sixel resolution (width and height in pixels)
CSI 14 t - Request window size in pixels (width x height)
CSI_RestoreAltBufferWithBackscroll
ESC [ ? 1047 l - Restore xterm working buffer (with backscroll)
CSI_RestoreCursorAndRestoreAltBufferWithBackscroll
ESC [ ? 1049 l - Restore cursor position and restore xterm working buffer (with backscroll)
ESC [ 8 - DECSR Restore Cursor Position from Memory**
CSI_SaveCursorAndActivateAltBufferNoBackscroll
ESC [ ? 1049 h - Save cursor position and activate xterm alternative buffer (no backscroll)
ESC [ 7 - Save Cursor Position in Memory**
ESC [ 0 c - Send Device Attributes (Primary DA) https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Application-Program-Command-functions https://www.xfree86.org/current/ctlseqs.html Windows Terminal v1.17 and below emits ā\x1b[?1;0cā, indicating "VT101 with No Options". Windows Terminal v1.18+ emits: \x1b[?61;6;7;22;23;24;28;32;42c" See https://github.com/microsoft/terminal/pull/14906 61 - The device conforms to level 1 of the character cell display architecture (See https://github.com/microsoft/terminal/issues/15693#issuecomment-1633304497) 6 = Selective erase 7 = Soft fonts 22 = Color text 23 = Greek character sets 24 = Turkish character sets 28 = Rectangular area operations 32 = Text macros 42 = ISO Latin-2 character set The terminator indicating a reply to CSI_SendDeviceAttributes orCSI_SendDeviceAttributes2
ESC [ > 0 c - Send Device Attributes (Secondary DA) Windows Terminal v1.18+ emits: "\x1b[>0;10;1c" (vt100, firmware version 1.0, vt220)
ESC [ ? 25 h - DECTCEM Text Cursor Enable Mode Show Show the cursor
Escape key code (ASCII 27/0x1B).
Properties
Specify the incomplete ConsoleKeyInfo array not yet recognized as valid ANSI escape sequence.
Methods
CSI_AppendBackgroundColorRGB(StringBuilder, int, int, int)
ESC[48;2;{r};{g};{b}m Append background color as RGB to StringBuilder.
CSI_AppendCursorPosition(StringBuilder, int, int)
ESC [ y ; x H - CUP Cursor Position - Cursor moves to x ; y coordinate within the viewport, where x is the column of the y line
CSI_AppendForegroundColorRGB(StringBuilder, int, int, int)
ESC[38;2;{r};{g};{b}m Append foreground color as RGB to StringBuilder.
CSI_ClearScreen(ClearScreenOptions)
ESC [ x J - Clears part of the screen. See EscSeqUtils.ClearScreenOptions.
CSI_SetBackgroundColor(AnsiColorCode)
ESC [ (n) m - Uses CSI_SetGraphicsRendition(params int[]) to set the background color.
CSI_SetBackgroundColor256(int)
ESC[48;5;{id}m - Set background color (256 colors)
CSI_SetBackgroundColorRGB(int, int, int)
ESC[48;2;{r};{g};{b}m Set background color as RGB.
CSI_SetCursorPosition(int, int)
ESC [ y ; x H - CUP Cursor Position - Cursor moves to x ; y coordinate within the viewport, where x is the column of the y line
CSI_SetCursorStyle(DECSCUSR_Style)
ESC [ n SP q - Select Cursor Style (DECSCUSR) https://terminalguide.namepad.de/seq/csi\_sq\_t\_space/
CSI_SetForegroundColor(AnsiColorCode)
ESC [ (n) m - Uses CSI_SetGraphicsRendition(params int[]) to set the foreground color.
CSI_SetForegroundColor256(int)
ESC[38;5;{id}m - Set foreground color (256 colors)
CSI_SetForegroundColorRGB(int, int, int)
ESC[38;2;{r};{g};{b}m Set foreground color as RGB.
CSI_SetGraphicsRendition(params int[])
ESC [ (n) m - SGR - Set Graphics Rendition - Set the format of the screen and text as specified by (n) This command is special in that the (n) position can accept between 0 and 16 parameters separated by semicolons. When no parameters are specified, it is treated the same as a single 0 parameter. https://terminalguide.namepad.de/seq/csi\_sm/
CSI_SetTerminalWindowSize(int, int)
ESC [ 8 ; height ; width t - Set Terminal Window Size https://terminalguide.namepad.de/seq/csi\_st-8/
CSI_WriteCursorPosition(TextWriter, int, int)
ESC [ y ; x H - CUP Cursor Position - Cursor moves to x ; y coordinate within the viewport, where x is the column of the y line
Decodes an ANSI escape sequence.
Gets the c1Control used in the called escape sequence.
GetConsoleKey(char, string?, ref ConsoleModifiers, ref char)
Gets the ConsoleKey depending on terminating and value.
Gets the ConsoleModifiers from the value.
Gets all the needed information about an escape sequence.
GetKeyCharArray(ConsoleKeyInfo[])
A helper to get only the KeyChar from the ConsoleKeyInfo array.
GetMouse(ConsoleKeyInfo[], out List, out Point, Action<MouseFlags, Point>)
Gets the MouseFlags mouse button flags and the position.
InsertArray(ConsoleKeyInfo[], ConsoleKeyInfo[], int)
Insert a ConsoleKeyInfo array into the another ConsoleKeyInfo array at the specified index.
MapConsoleKeyInfo(ConsoleKeyInfo)
Ensures a console key is mapped to one that works correctly with ANSI escape sequences.
ProcessMouseEvent(MouseFlags, Point)
Provides a default mouse event handler that can be used by any driver.
ResizeArray(ConsoleKeyInfo, ConsoleKeyInfo[])
A helper to resize the ConsoleKeyInfo as needed.
Split a raw string into a list of string with the correct ansi escape sequence.
Convert a string to ConsoleKeyInfo array.
Convert a ConsoleKeyInfo array to string.
Events
Provides a handler to be invoked when mouse continuous button pressed is processed.