@@ -180,18 +180,20 @@ interface Capabilities {
180180 readonly xenl: boolean ;
181181 readonly altScreen: boolean ;
182182 readonly styledUnderline: boolean ;
183+ readonly syncOutput: boolean ;
183184}
184185```
185186
186- | Field | Source |
187- | ----------------- | ------------------------------------------------------------------- |
188- | ` colors ` | ` max_colors ` from terminfo; 256 at baseline |
189- | ` trueColor ` | ` RGB ` /` Tc ` extended caps; ` COLORTERM ` env evidence; probe overrides |
190- | ` bce ` | ` bce ` boolean cap |
191- | ` autoMargin ` | ` am ` boolean cap |
192- | ` xenl ` | ` xenl ` boolean cap |
193- | ` altScreen ` | ` smcup ` string present |
194- | ` styledUnderline ` | ` Su ` boolean or ` Smulx ` string |
187+ | Field | Source |
188+ | ----------------- | ----------------------------------------------------------------------- |
189+ | ` colors ` | ` max_colors ` from terminfo; 256 at baseline |
190+ | ` trueColor ` | ` RGB ` /` Tc ` extended caps; ` COLORTERM ` env evidence; probe overrides |
191+ | ` bce ` | ` bce ` boolean cap |
192+ | ` autoMargin ` | ` am ` boolean cap |
193+ | ` xenl ` | ` xenl ` boolean cap |
194+ | ` altScreen ` | ` smcup ` string present |
195+ | ` styledUnderline ` | ` Su ` boolean or ` Smulx ` string |
196+ | ` syncOutput ` | ` Sync ` extended cap; ` TMUX ` env evidence (§7.2); probe overrides (§6.3) |
195197
196198Key sequences (` key_* ` capabilities) are not stored here. The input parser reads
197199them directly from the raw terminfo bytes in ` TerminalInfo.keys ` at
@@ -252,20 +254,20 @@ type CapabilityEvent =
252254 };
253255```
254256
255- Each variant maps to one probe query. The ` key ` identifies the capability; the
256- ` value ` is the terminal's answer. Capability references per
257+ Each variant maps to at least one probe query. The ` key ` identifies the
258+ capability; the ` value ` is the terminal's answer. Capability references per
257259[ terminfo.dev] ( https://terminfo.dev ) :
258260
259- | ` key ` | Query | terminfo.dev slug |
260- | ------------------ | -------------------- | ----------------------------------------------------------------------------------------------- |
261- | ` foreground-color ` | OSC 10 | [ ` osc-10-fg-color-query ` ] ( https://terminfo.dev/extensions/osc-10-fg-color-query ) |
262- | ` background-color ` | OSC 11 | [ ` osc-11-bg-color-query ` ] ( https://terminfo.dev/extensions/osc-11-bg-color-query ) |
263- | ` cursor-color ` | OSC 12 or OSC 21 | [ ` osc-12-cursor-color ` ] ( https://terminfo.dev/extensions/osc-12-cursor-color ) |
264- | ` colordepth ` | XTGETTCAP ` RGB ` /` Tc ` | [ ` 24-bit-truecolor ` ] ( https://terminfo.dev/extensions/24-bit-truecolor ) |
265- | ` sync-output ` | DECRPM mode 2026 | [ ` decset-2026-synchronized-output ` ] ( https://terminfo.dev/modes/decset-2026-synchronized-output ) |
266- | ` kitty-keyboard ` | ` CSI ? u ` | [ ` kitty-keyboard-protocol ` ] ( https://terminfo.dev/extensions/kitty-keyboard-protocol ) |
267- | ` kitty-graphics ` | APC ` _G… ` | [ ` kitty-graphics-protocol ` ] ( https://terminfo.dev/extensions/kitty-graphics-protocol ) |
268- | ` pointer-shape ` | OSC 22 | [ ` osc-22-pointer-shape ` ] ( https://terminfo.dev/extensions/osc-22-pointer-shape ) |
261+ | ` key ` | Query | terminfo.dev slug |
262+ | ------------------ | ---------------------------------- | ----------------------------------------------------------------------------------------------- |
263+ | ` foreground-color ` | OSC 10 | [ ` osc-10-fg-color-query ` ] ( https://terminfo.dev/extensions/osc-10-fg-color-query ) |
264+ | ` background-color ` | OSC 11 | [ ` osc-11-bg-color-query ` ] ( https://terminfo.dev/extensions/osc-11-bg-color-query ) |
265+ | ` cursor-color ` | OSC 12 or OSC 21 | [ ` osc-12-cursor-color ` ] ( https://terminfo.dev/extensions/osc-12-cursor-color ) |
266+ | ` colordepth ` | XTGETTCAP ` RGB ` /` Tc ` | [ ` 24-bit-truecolor ` ] ( https://terminfo.dev/extensions/24-bit-truecolor ) |
267+ | ` sync-output ` | DECRPM mode 2026; XTGETTCAP ` Sync ` | [ ` decset-2026-synchronized-output ` ] ( https://terminfo.dev/modes/decset-2026-synchronized-output ) |
268+ | ` kitty-keyboard ` | ` CSI ? u ` | [ ` kitty-keyboard-protocol ` ] ( https://terminfo.dev/extensions/kitty-keyboard-protocol ) |
269+ | ` kitty-graphics ` | APC ` _G… ` | [ ` kitty-graphics-protocol ` ] ( https://terminfo.dev/extensions/kitty-graphics-protocol ) |
270+ | ` pointer-shape ` | OSC 22 | [ ` osc-22-pointer-shape ` ] ( https://terminfo.dev/extensions/osc-22-pointer-shape ) |
269271
270272** Color values.** ` Rgb ` values in probe responses MUST be recognized in at least
271273the ` rgb:RR/GG/BB ` (1–4 hex digits per channel) and ` # ` -hash forms.
@@ -278,6 +280,16 @@ D }` where `D` is derived from the static
278280preserves TINV-3: the probe response takes precedence over static evidence,
279281including in the negative direction.
280282
283+ ** XTGETTCAP ` Sync ` .** A reply carrying a value for ` Sync ` emits
284+ ` { key: "sync-output", value: true } ` . An invalid-capability reply for ` Sync `
285+ emits ` { key: "sync-output", value: false } ` . The value carried by a positive
286+ reply is the terminal's own synchronization sequence — the iTerm2 DCS form
287+ (` DCS = 1 s ` / ` DCS = 2 s ` ) for some terminals, ` CSI ? 2026 h ` /` l ` for others.
288+ The value is discarded in v1: only support is recorded, and the renderer emits
289+ the DEC mode 2026 form (renderer-spec §7.9). A terminal that advertises only the
290+ DCS form therefore receives 2026-form bytes it ignores; this bounded cost is
291+ accepted.
292+
281293** OSC 21.** An OSC 21 reply may supply any subset of ` foreground-color ` ,
282294` background-color ` , and ` cursor-color ` . The parser emits one ` CapabilityEvent `
283295per field the reply carries. OSC 21 arriving alongside OSC 10/11/12 replies does
@@ -331,15 +343,24 @@ With no terminfo bytes, no environment evidence, and no probe responses,
331343| ` xenl ` | ` true ` |
332344| ` altScreen ` | ` true ` |
333345| ` styledUnderline ` | ` false ` |
346+ | ` syncOutput ` | ` false ` |
334347
335348Truecolor is not assumed at baseline. Per TINV-3, it requires positive evidence.
349+ The same holds for synchronized output: no frame is wrapped until a ` Sync `
350+ extended capability, ` TMUX ` environment evidence, or a probe response raises it
351+ (§7.2, §6.3).
336352
337353### 7.2 Environment evidence
338354
339355` detectTerminal() ` applies environment evidence after parsing the terminfo
340356entry:
341357
342358- ` COLORTERM ` equal to ` truecolor ` or ` 24bit ` sets ` trueColor: true ` .
359+ - ` TMUX ` set to a non-empty value sets ` syncOutput: true ` . A running tmux
360+ consumes DEC mode 2026 from applications running inside it and translates it
361+ to the outer terminal's synchronization mechanism (the tmux ` Sync ` terminfo
362+ capability and ` sync ` terminal feature), so its presence is positive evidence
363+ even for tmux releases that do not themselves answer the DECRPM 2026 probe.
343364
344365Environment evidence outranks the terminfo entry and is outranked by probe
345366responses (TINV-3).
@@ -368,7 +389,7 @@ observe only the resulting `Capabilities`.
368389- Both storage formats MUST be supported: legacy (magic `0432`, 16-bit numbers)
369390 and extended number format (magic `01036`, 32-bit numbers).
370391- The extended-capability string table MUST be parsed for the user-defined
371- capabilities `RGB`, `Tc`, `Su`, and `Smulx `.
392+ capabilities `RGB`, `Tc`, `Su`, `Smulx`, and `Sync `.
372393- All reads are bounds-checked against `len`. Out-of-range offsets, truncated
373394 sections, and odd-length string tables yield the parse failure path (TINV-2).
374395- The maximum accepted size is 32 768 bytes, the extended ncurses format limit.
@@ -398,13 +419,14 @@ order:
398419| 5 | Pointer shape | `OSC 22 ; ?__current__ ST` | `pointer-shape` |
399420| 6 | Truecolor caps | `DCS + q 524742 ; 5463 ST` (XTGETTCAP `RGB;Tc`) | `colordepth` |
400421| 7 | Synchronized output | `CSI ? 2026 $ p` (DECRQM) | `sync-output` |
401- | 8 | Kitty keyboard | `CSI ? u` | `kitty-keyboard` |
402- | 9 | Kitty graphics | `APC _G i=31,s=1,v=1,a=q,t=d,f=24 ; AAAA ST` | `kitty-graphics` |
403- | 10 | **Fence:** DA1 | `CSI c` | (internal only) |
422+ | 8 | Sync terminfo cap | `DCS + q 53796e63 ST` (XTGETTCAP `Sync`) | `sync-output` |
423+ | 9 | Kitty keyboard | `CSI ? u` | `kitty-keyboard` |
424+ | 10 | Kitty graphics | `APC _G i=31,s=1,v=1,a=q,t=d,f=24 ; AAAA ST` | `kitty-graphics` |
425+ | 11 | **Fence:** DA1 | `CSI c` | (internal only) |
404426
405427Terminals answer queries in order and ignore queries they do not understand. DA1
406428is answered by every terminal, so its response marks the probe complete. Any of
407- queries 1–9 not yet answered when the DA1 reply arrives will never be answered,
429+ queries 1–10 not yet answered when the DA1 reply arrives will never be answered,
408430and the renderer keeps their current values.
409431
410432The batch is safe to emit unconditionally: every query is either answered or
0 commit comments