GhosttyTerminalData enum
Terminal data types.
These values specify what type of data to extract from a terminal
using ghostty_terminal_get.
@ingroup terminal
Values
- GHOSTTY_TERMINAL_DATA_INVALID → const GhosttyTerminalData
-
Invalid data type. Never results in any data extraction.
const GhosttyTerminalData(0) - GHOSTTY_TERMINAL_DATA_COLS → const GhosttyTerminalData
-
Terminal width in cells.
Output type: uint16_t *
const GhosttyTerminalData(1) - GHOSTTY_TERMINAL_DATA_ROWS → const GhosttyTerminalData
-
Terminal height in cells.
Output type: uint16_t *
const GhosttyTerminalData(2) - GHOSTTY_TERMINAL_DATA_CURSOR_X → const GhosttyTerminalData
-
Cursor column position (0-indexed).
Output type: uint16_t *
const GhosttyTerminalData(3) - GHOSTTY_TERMINAL_DATA_CURSOR_Y → const GhosttyTerminalData
-
Cursor row position within the active area (0-indexed).
Output type: uint16_t *
const GhosttyTerminalData(4) - GHOSTTY_TERMINAL_DATA_CURSOR_PENDING_WRAP → const GhosttyTerminalData
-
Whether the cursor has a pending wrap (next print will soft-wrap).
Output type: bool *
const GhosttyTerminalData(5) - GHOSTTY_TERMINAL_DATA_ACTIVE_SCREEN → const GhosttyTerminalData
-
The currently active screen.
Output type: GhosttyTerminalScreen *
const GhosttyTerminalData(6) - GHOSTTY_TERMINAL_DATA_CURSOR_VISIBLE → const GhosttyTerminalData
-
Whether the cursor is visible (DEC mode 25).
Output type: bool *
const GhosttyTerminalData(7) - GHOSTTY_TERMINAL_DATA_KITTY_KEYBOARD_FLAGS → const GhosttyTerminalData
-
Current Kitty keyboard protocol flags.
Output type: GhosttyKittyKeyFlags * (uint8_t *)
const GhosttyTerminalData(8) - GHOSTTY_TERMINAL_DATA_SCROLLBAR → const GhosttyTerminalData
-
Scrollbar state for the terminal viewport.
This is amortized O(1): the total is maintained incrementally as the terminal is modified and the viewport offset is cached. The first read after the viewport moves to an arbitrary position that isn't an absolute row (e.g. scrolling to a selection) may cost O(pages) to compute the offset, after which it is cached again.
There is intentionally no change notification for scroll state. Callers building scrollbars should poll this once per frame or per write batch and diff the result to detect changes; this is what Ghostty's own renderer does.
Output type: GhosttyTerminalScrollbar *
const GhosttyTerminalData(9) - GHOSTTY_TERMINAL_DATA_CURSOR_STYLE → const GhosttyTerminalData
-
The current SGR style of the cursor.
This is the style that will be applied to newly printed characters.
Output type: GhosttyStyle *
const GhosttyTerminalData(10) - GHOSTTY_TERMINAL_DATA_MOUSE_TRACKING → const GhosttyTerminalData
-
Whether any mouse tracking mode is active.
Returns true if any of the mouse tracking modes (X10, normal, button, or any-event) are enabled.
Output type: bool *
const GhosttyTerminalData(11) - GHOSTTY_TERMINAL_DATA_TITLE → const GhosttyTerminalData
-
The terminal title as set by escape sequences (e.g. OSC 0/2).
Returns a borrowed string. The pointer is valid until the next mutating terminal call. An empty string (len=0) is returned when no title has been set.
Output type: GhosttyString *
const GhosttyTerminalData(12) - GHOSTTY_TERMINAL_DATA_PWD → const GhosttyTerminalData
-
The terminal's current working directory as set by escape sequences (e.g. OSC 7).
Returns a borrowed string. The pointer is valid until the next mutating terminal call. An empty string (len=0) is returned when no pwd has been set.
Output type: GhosttyString *
const GhosttyTerminalData(13) - GHOSTTY_TERMINAL_DATA_TOTAL_ROWS → const GhosttyTerminalData
-
The total number of rows in the active screen including scrollback.
Output type: size_t *
const GhosttyTerminalData(14) - GHOSTTY_TERMINAL_DATA_SCROLLBACK_ROWS → const GhosttyTerminalData
-
The number of scrollback rows (total rows minus viewport rows).
Output type: size_t *
const GhosttyTerminalData(15) - GHOSTTY_TERMINAL_DATA_WIDTH_PX → const GhosttyTerminalData
-
The total width of the terminal in pixels.
This is cols * cell_width_px as set by ghostty_terminal_resize().
Output type: uint32_t *
const GhosttyTerminalData(16) - GHOSTTY_TERMINAL_DATA_HEIGHT_PX → const GhosttyTerminalData
-
The total height of the terminal in pixels.
This is rows * cell_height_px as set by ghostty_terminal_resize().
Output type: uint32_t *
const GhosttyTerminalData(17) - GHOSTTY_TERMINAL_DATA_COLOR_FOREGROUND → const GhosttyTerminalData
-
The effective foreground color (override or default).
Returns GHOSTTY_NO_VALUE if no foreground color is set.
Output type: GhosttyColorRgb *
const GhosttyTerminalData(18) - GHOSTTY_TERMINAL_DATA_COLOR_BACKGROUND → const GhosttyTerminalData
-
The effective background color (override or default).
Returns GHOSTTY_NO_VALUE if no background color is set.
Output type: GhosttyColorRgb *
const GhosttyTerminalData(19) - GHOSTTY_TERMINAL_DATA_COLOR_CURSOR → const GhosttyTerminalData
-
The effective cursor color (override or default).
Returns GHOSTTY_NO_VALUE if no cursor color is set.
Output type: GhosttyColorRgb *
const GhosttyTerminalData(20) - GHOSTTY_TERMINAL_DATA_COLOR_PALETTE → const GhosttyTerminalData
-
The current 256-color palette.
Output type:
GhosttyColorRgb[256]*const GhosttyTerminalData(21) - GHOSTTY_TERMINAL_DATA_COLOR_FOREGROUND_DEFAULT → const GhosttyTerminalData
-
The default foreground color (ignoring any OSC override).
Returns GHOSTTY_NO_VALUE if no default foreground color is set.
Output type: GhosttyColorRgb *
const GhosttyTerminalData(22) - GHOSTTY_TERMINAL_DATA_COLOR_BACKGROUND_DEFAULT → const GhosttyTerminalData
-
The default background color (ignoring any OSC override).
Returns GHOSTTY_NO_VALUE if no default background color is set.
Output type: GhosttyColorRgb *
const GhosttyTerminalData(23) - GHOSTTY_TERMINAL_DATA_COLOR_CURSOR_DEFAULT → const GhosttyTerminalData
-
The default cursor color (ignoring any OSC override).
Returns GHOSTTY_NO_VALUE if no default cursor color is set.
Output type: GhosttyColorRgb *
const GhosttyTerminalData(24) - GHOSTTY_TERMINAL_DATA_COLOR_PALETTE_DEFAULT → const GhosttyTerminalData
-
The default 256-color palette (ignoring any OSC overrides).
Output type:
GhosttyColorRgb[256]*const GhosttyTerminalData(25) - GHOSTTY_TERMINAL_DATA_KITTY_IMAGE_STORAGE_LIMIT → const GhosttyTerminalData
-
The Kitty image storage limit in bytes for the active screen.
A value of zero means the Kitty graphics protocol is disabled. Returns GHOSTTY_NO_VALUE when Kitty graphics are disabled at build time.
Output type: uint64_t *
const GhosttyTerminalData(26) - GHOSTTY_TERMINAL_DATA_KITTY_IMAGE_MEDIUM_FILE → const GhosttyTerminalData
-
Whether the file medium is enabled for Kitty image loading on the active screen.
Returns GHOSTTY_NO_VALUE when Kitty graphics are disabled at build time.
Output type: bool *
const GhosttyTerminalData(27) - GHOSTTY_TERMINAL_DATA_KITTY_IMAGE_MEDIUM_TEMP_FILE → const GhosttyTerminalData
-
The directory allowed for Kitty image loading via the temporary file medium on the active screen. The string is empty when the medium is disabled.
Returns GHOSTTY_NO_VALUE when Kitty graphics are disabled at build time.
Output type: GhosttyString *
const GhosttyTerminalData(28) - GHOSTTY_TERMINAL_DATA_KITTY_IMAGE_MEDIUM_SHARED_MEM → const GhosttyTerminalData
-
Whether the shared memory medium is enabled for Kitty image loading on the active screen.
Returns GHOSTTY_NO_VALUE when Kitty graphics are disabled at build time.
Output type: bool *
const GhosttyTerminalData(29) - GHOSTTY_TERMINAL_DATA_KITTY_GRAPHICS → const GhosttyTerminalData
-
The Kitty graphics image storage for the active screen.
Returns a borrowed pointer to the image storage. The pointer is valid until the next mutating terminal call (e.g. ghostty_terminal_vt_write() or ghostty_terminal_reset()).
Returns GHOSTTY_NO_VALUE when Kitty graphics are disabled at build time.
Output type: GhosttyKittyGraphics *
const GhosttyTerminalData(30) - GHOSTTY_TERMINAL_DATA_SELECTION → const GhosttyTerminalData
-
The active screen's current selection.
On success, writes an untracked snapshot of the terminal-owned selection to the caller-provided GhosttySelection. The GhosttySelection struct is caller-owned and may be kept, but the grid references inside it are untracked borrowed references into the active screen. They are only valid until the next mutating terminal call, such as ghostty_terminal_set(), ghostty_terminal_vt_write(), ghostty_terminal_resize(), or ghostty_terminal_reset().
Returns GHOSTTY_NO_VALUE when there is no active selection.
Output type: GhosttySelection *
const GhosttyTerminalData(31) - GHOSTTY_TERMINAL_DATA_VIEWPORT_ACTIVE → const GhosttyTerminalData
-
Whether the viewport is currently pinned to the active area.
This is true when the viewport is following the active terminal area, and false when the user has scrolled into history.
Output type: bool *
const GhosttyTerminalData(32) - GHOSTTY_TERMINAL_DATA_VT_PROCESSING_ERROR → const GhosttyTerminalData
-
Whether VT processing encountered a non-gracefully handled error that may have prevented a terminal-owned semantic update.
Processing remains best-effort, and ghostty_terminal_reset() does not clear it. Gracefully handled protocol failures, configured limits, malformed or unsupported input, and failures limited to external effects or query responses do not set it.
This can't currently be unset. This is purely informational to consumers if there was some error that happened at some point during VT processing.
Output type: bool *
const GhosttyTerminalData(33) - GHOSTTY_TERMINAL_DATA_SCROLLBACK_MAX_BYTES → const GhosttyTerminalData
-
The configured maximum scrollback allocation in bytes.
This always reports the primary screen's configured value, including while an alternate screen is active. Returns GHOSTTY_NO_VALUE when the configured byte limit is unlimited.
Output type: size_t *
const GhosttyTerminalData(34) - GHOSTTY_TERMINAL_DATA_SCROLLBACK_MAX_LINES → const GhosttyTerminalData
-
The configured maximum number of physical scrollback lines.
This always reports the primary screen's configured value, including while an alternate screen is active. Returns GHOSTTY_NO_VALUE when the configured line limit is unlimited.
Output type: size_t *
const GhosttyTerminalData(35) - GHOSTTY_TERMINAL_DATA_CONTINUATION_MAX_BYTES → const GhosttyTerminalData
-
The configured maximum retained VT continuation size in bytes.
A value of zero means continuation tracking is disabled. This reports the configured limit even when a current unfinished continuation is temporarily unavailable.
Output type: size_t *
const GhosttyTerminalData(36) - GHOSTTY_TERMINAL_DATA_MODE → const GhosttyTerminalData
-
Get the current value of a terminal mode.
The caller must initialize the
modefield. On success, thevaluefield is updated with the current value. A NULL pointer or unknown mode returns GHOSTTY_INVALID_VALUE.Input/output type: GhosttyTerminalModeConfig *
const GhosttyTerminalData(37) - GHOSTTY_TERMINAL_DATA_VT_GROUND → const GhosttyTerminalData
-
Whether VT processing is at ground.
Ground is when the stream isn't in the middle of any type of sequence: UTF-8, ESC, CSI, OSC, etc. It is the stateless point of the stream.
This is useful to know because it is a point at which you can safely insert out-of-band VT sequences. For example, while reading from a pty if you want to make your own changes, you can wait until the pty input reaches ground, then write yours.
Output type: bool *
const GhosttyTerminalData(38) - GHOSTTY_TERMINAL_DATA_CURSOR_AT_PROMPT → const GhosttyTerminalData
-
Whether the cursor is currently at a semantic shell prompt or input area.
This depends on semantic prompt markers such as OSC 133. Returns false when semantic prompt information is unavailable or the alternate screen is active.
Output type: bool *
const GhosttyTerminalData(39) - GHOSTTY_TERMINAL_DATA_CLIPBOARD_WRITE_MAX_BYTES → const GhosttyTerminalData
-
The configured maximum decoded bytes per Kitty clipboard protocol (OSC 5522) write transaction. See GHOSTTY_TERMINAL_OPT_CLIPBOARD_WRITE_MAX_BYTES.
Output type: size_t *
const GhosttyTerminalData(40) - GHOSTTY_TERMINAL_DATA_MAX_VALUE → const GhosttyTerminalData
-
const GhosttyTerminalData(2147483647)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → int
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromValue(
int value) → GhosttyTerminalData
Constants
-
values
→ const List<
GhosttyTerminalData> - A constant List of the values in this enum, in order of their declaration.