![]() |
libghostty
|
Terminal screen cell and row types.
These types represent the contents of a terminal screen. A GhosttyCell is a single grid cell and a GhosttyRow is a single row. Both are opaque values whose fields are accessed via ghostty_cell_get() and ghostty_row_get() respectively.
Typedefs | |
| typedef uint64_t | GhosttyCell |
| typedef uint64_t | GhosttyRow |
Functions | |
| GhosttyResult | ghostty_cell_get (GhosttyCell cell, GhosttyCellData data, void *out) |
| GhosttyResult | ghostty_row_get (GhosttyRow row, GhosttyRowData data, void *out) |
| typedef uint64_t GhosttyCell |
Opaque cell value.
Represents a single terminal cell. The internal layout is opaque and must be queried via ghostty_cell_get(). Obtain cell values from terminal query APIs.
| typedef uint64_t GhosttyRow |
Opaque row value.
Represents a single terminal row. The internal layout is opaque and must be queried via ghostty_row_get(). Obtain row values from terminal query APIs.
Cell content tag.
Describes what kind of content a cell holds.
| enum GhosttyCellData |
Cell data types.
These values specify what type of data to extract from a cell using ghostty_cell_get.
| Enumerator | |
|---|---|
| GHOSTTY_CELL_DATA_INVALID | Invalid data type. Never results in any data extraction. |
| GHOSTTY_CELL_DATA_CODEPOINT | The codepoint of the cell (0 if empty or bg-color-only). Output type: uint32_t * |
| GHOSTTY_CELL_DATA_CONTENT_TAG | The content tag describing what kind of content is in the cell. Output type: GhosttyCellContentTag * |
| GHOSTTY_CELL_DATA_WIDE | The wide property of the cell. Output type: GhosttyCellWide * |
| GHOSTTY_CELL_DATA_HAS_TEXT | Whether the cell has text to render. Output type: bool * |
| GHOSTTY_CELL_DATA_HAS_STYLING | Whether the cell has non-default styling. Output type: bool * |
| GHOSTTY_CELL_DATA_STYLE_ID | The style ID for the cell (for use with style lookups). Output type: uint16_t * |
| GHOSTTY_CELL_DATA_HAS_HYPERLINK | Whether the cell has a hyperlink. Output type: bool * |
| GHOSTTY_CELL_DATA_PROTECTED | Whether the cell is protected. Output type: bool * |
| GHOSTTY_CELL_DATA_SEMANTIC_CONTENT | The semantic content type of the cell (from OSC 133). Output type: GhosttyCellSemanticContent * |
Semantic content type of a cell.
Set by semantic prompt sequences (OSC 133) to distinguish between command output, user input, and shell prompt text.
| enum GhosttyCellWide |
Cell wide property.
Describes the width behavior of a cell.
| enum GhosttyRowData |
Row data types.
These values specify what type of data to extract from a row using ghostty_row_get.
| Enumerator | |
|---|---|
| GHOSTTY_ROW_DATA_INVALID | Invalid data type. Never results in any data extraction. |
| GHOSTTY_ROW_DATA_WRAP | Whether this row is soft-wrapped. Output type: bool * |
| GHOSTTY_ROW_DATA_WRAP_CONTINUATION | Whether this row is a continuation of a soft-wrapped row. Output type: bool * |
| GHOSTTY_ROW_DATA_GRAPHEME | Whether any cells in this row have grapheme clusters. Output type: bool * |
| GHOSTTY_ROW_DATA_STYLED | Whether any cells in this row have styling (may have false positives). Output type: bool * |
| GHOSTTY_ROW_DATA_HYPERLINK | Whether any cells in this row have hyperlinks (may have false positives). Output type: bool * |
| GHOSTTY_ROW_DATA_SEMANTIC_PROMPT | The semantic prompt state of this row. Output type: GhosttyRowSemanticPrompt * |
| GHOSTTY_ROW_DATA_KITTY_VIRTUAL_PLACEHOLDER | Whether this row contains a Kitty virtual placeholder. Output type: bool * |
| GHOSTTY_ROW_DATA_DIRTY | Whether this row is dirty and requires a redraw. Output type: bool * |
Row semantic prompt state.
Indicates whether any cells in a row are part of a shell prompt, as reported by OSC 133 sequences.
| GhosttyResult ghostty_cell_get | ( | GhosttyCell | cell, |
| GhosttyCellData | data, | ||
| void * | out ) |
Get data from a cell.
Extracts typed data from the given cell based on the specified data type. The output pointer must be of the appropriate type for the requested data kind. Valid data types and output types are documented in the GhosttyCellData enum.
| cell | The cell value |
| data | The type of data to extract |
| out | Pointer to store the extracted data (type depends on data parameter) |
| GhosttyResult ghostty_row_get | ( | GhosttyRow | row, |
| GhosttyRowData | data, | ||
| void * | out ) |
Get data from a row.
Extracts typed data from the given row based on the specified data type. The output pointer must be of the appropriate type for the requested data kind. Valid data types and output types are documented in the GhosttyRowData enum.
| row | The row value |
| data | The type of data to extract |
| out | Pointer to store the extracted data (type depends on data parameter) |