From 5b9a77f203865e73de885df743afc73af96fba50 Mon Sep 17 00:00:00 2001 From: Elias Andualem Date: Tue, 18 Aug 2026 15:34:07 +0300 Subject: [PATCH] terminal: document mode 2048 size reports --- include/ghostty/vt/terminal.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/include/ghostty/vt/terminal.h b/include/ghostty/vt/terminal.h index 57d0e5d03..5133756f9 100644 --- a/include/ghostty/vt/terminal.h +++ b/include/ghostty/vt/terminal.h @@ -86,13 +86,13 @@ extern "C" { * * | Option | Callback Type | Trigger | * |-----------------------------------------|-----------------------------------|-------------------------------------------| - * | `GHOSTTY_TERMINAL_OPT_WRITE_PTY` | `GhosttyTerminalWritePtyFn` | Query responses written back to the pty | + * | `GHOSTTY_TERMINAL_OPT_WRITE_PTY` | `GhosttyTerminalWritePtyFn` | VT query and mode reports written back to the PTY | * | `GHOSTTY_TERMINAL_OPT_BELL` | `GhosttyTerminalBellFn` | BEL character (0x07) | * | `GHOSTTY_TERMINAL_OPT_TITLE_CHANGED` | `GhosttyTerminalTitleChangedFn` | Title change via OSC 0 / OSC 2 | * | `GHOSTTY_TERMINAL_OPT_PWD_CHANGED` | `GhosttyTerminalPwdChangedFn` | Pwd change via OSC 7 / OSC 9 / OSC 1337 | * | `GHOSTTY_TERMINAL_OPT_ENQUIRY` | `GhosttyTerminalEnquiryFn` | ENQ character (0x05) | * | `GHOSTTY_TERMINAL_OPT_XTVERSION` | `GhosttyTerminalXtversionFn` | XTVERSION query (CSI > q) | - * | `GHOSTTY_TERMINAL_OPT_SIZE` | `GhosttyTerminalSizeFn` | XTWINOPS size query (CSI 14/16/18 t) | + * | `GHOSTTY_TERMINAL_OPT_SIZE` | `GhosttyTerminalSizeFn` | XTWINOPS query (CSI 14/16/18 t) or mode 2048 enable | * | `GHOSTTY_TERMINAL_OPT_COLOR_SCHEME` | `GhosttyTerminalColorSchemeFn` | Color scheme query (CSI ? 996 n) | * | `GHOSTTY_TERMINAL_OPT_DEVICE_ATTRIBUTES`| `GhosttyTerminalDeviceAttributesFn`| Device attributes query (CSI c / > c / = c)| * | `GHOSTTY_TERMINAL_OPT_CLIPBOARD_WRITE` | `GhosttyTerminalClipboardWriteFn` | Clipboard write via OSC 52 / OSC 1337 | @@ -688,16 +688,18 @@ typedef GhosttyString (*GhosttyTerminalEnquiryFn)(GhosttyTerminal terminal, void* userdata); /** - * Callback function type for size queries (XTWINOPS). + * Callback function type for terminal size reports. * - * Called in response to XTWINOPS size queries (CSI 14/16/18 t). + * Called in response to XTWINOPS size queries (CSI 14/16/18 t) and when VT + * input enables in-band size reports (mode 2048). * Return true and fill *out_size with the current terminal geometry, - * or return false to silently ignore the query. + * or return false to suppress the report. * * @param terminal The terminal handle * @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA * @param[out] out_size Pointer to store the terminal size information - * @return true if size was filled, false to ignore the query + * @return true if size was filled, false to suppress the XTWINOPS response or + * mode 2048 report * * @ingroup terminal */ @@ -749,9 +751,9 @@ typedef void (*GhosttyTerminalPwdChangedFn)(GhosttyTerminal terminal, * Callback function type for write_pty. * * Called when the terminal needs to write data back to the pty, for - * example in response to a device status report or mode query. The - * data is only valid for the duration of the call; callers must copy - * it if it needs to persist. + * example in response to a device status report, mode query, or VT-driven + * mode 2048 enable. The data is only valid for the duration of the call; + * callers must copy it if it needs to persist. * * @param terminal The terminal handle * @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA @@ -818,8 +820,9 @@ typedef enum GHOSTTY_ENUM_TYPED { /** * Callback invoked when the terminal needs to write data back - * to the pty (e.g. in response to a DECRQM query or device - * status report). Set to NULL to ignore such sequences. + * to the pty (e.g. in response to a DECRQM query, device status + * report, or VT-driven mode 2048 enable). Set to NULL to ignore such + * sequences. * * Input type: GhosttyTerminalWritePtyFn */