Navigation
API > API/Plugins > API/Plugins/Terminal
VT/ANSI escape sequence parser implemented as a state machine.
Follows the Paul Williams / vt100.net canonical parser model with 14 states, "anywhere" transitions (ESC/CAN/SUB), and proper C0 mid-sequence execution.
Processes a byte buffer of UTF-8 text containing VT sequences and applies the resulting actions to an FTerminalBuffer.
| Name | FVTParser |
| Type | class |
| Header File | /Engine/Plugins/Experimental/Terminal/Source/Terminal/Public/VTParser.h |
| Include Path | #include "VTParser.h" |
Syntax
class FVTParser
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FVTParser() |
VTParser.h |
Enums
Public
| Name | Remarks |
|---|---|
| EMouseTrackingMode | Mouse tracking mode set via DECSET 1000/1002/1003. |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AnsiPalette | FColor | 16-color ANSI palette (indices 0-15). Initialized with defaults, overridden by color scheme. | VTParser.h | |
| bApplicationCursorKeys | bool | VTParser.h | ||
| bAutoWrap | bool | Mode flags. | VTParser.h | |
| bBracketedPaste | bool | VTParser.h | ||
| bCursorVisible | bool | VTParser.h | ||
| bSGRMouseEncoding | bool | VTParser.h | ||
| bSynchronizedOutput | bool | VTParser.h | ||
| CurrentAttributes | uint8 | VTParser.h | ||
| CurrentBackground | FColor | VTParser.h | ||
| CurrentForeground | FColor | Current SGR state applied to newly written cells. | VTParser.h | |
| MouseTrackingMode | EMouseTrackingMode | VTParser.h | ||
| ResponseBuffer | TArray< uint8 > | Response buffer - bytes to send back to the PTY (DA, DSR replies). Drained by STerminal::OnTick. | VTParser.h | |
| ScrollRegionBottom | int32 | VTParser.h | ||
| ScrollRegionTop | int32 | Scroll region (viewport-relative, inclusive). -1 means default (full viewport). | VTParser.h | |
| TabStops | TArray< bool > | Tab stops. | VTParser.h | |
| WindowTitle | FString | Window title set via OSC. | VTParser.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Buffer | FTerminalBuffer * | VTParser.h | ||
| CSIIntermediateChars | FString | VTParser.h | ||
| CSIParams | TArray< int32 > | CSI/DCS parameter accumulation. | VTParser.h | |
| CSIPrivatePrefix | TCHAR | CSI private parameter prefix character ('<', '=', '>', '?'), or '\0' for none. | VTParser.h | |
| CurrentParam | FString | VTParser.h | ||
| EscapeIntermediateChars | FString | Escape sequence intermediate characters accumulator. | VTParser.h | |
| OSCPayload | FString | OSC accumulation. | VTParser.h | |
| State | EParserState | VTParser.h | ||
| UTF8Codepoint | uint32 | UTF-8 decoder state. | VTParser.h | |
| UTF8MinCodepoint | uint32 | VTParser.h | ||
| UTF8Remaining | int32 | VTParser.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FString GetDebugStateName() |
Get the current parser state as a debug string. | VTParser.h | |
void InitializeTabStops() |
Initialize default tab stops (every 8 columns). | VTParser.h | |
void Parse
(
const uint8* Data, |
Parse a chunk of UTF-8 bytes. | VTParser.h | |
void Reset() |
Reset the parser and SGR state to defaults. | VTParser.h | |
void SetBuffer
(
FTerminalBuffer* InBuffer |
Bind the parser to a terminal buffer. Must be called before Parse(). | VTParser.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool IsZeroWidthCodepoint
(
uint32 Codepoint |
Check if a codepoint is zero-width (combining marks, variation selectors, etc.). | VTParser.h |