Repository navigation
feat(term): synchronized output (DEC mode 2026) via the sync-output capability - #139
Open
natemoo-re wants to merge 6 commits into
Open
natemoo-re wants to merge 6 commits into
natemoo-re wants to merge 6 commits into
Conversation
… capability Full-screen frames wrap in BSU/ESU when RuntimeCapabilities.syncOutput is true; the flag rides reduce() per frame so a capability flip takes effect on the next rendered frame with no invalidation signal. Zero-diff frames emit zero bytes even when wrapped, and line mode is never wrapped. Renderer-spec 7.9 discharges the deferral recorded in 7.8.
Contributor
Changeset suggestionThe current changeset no longer matches this PR. This review contains a corrected replacement. Why: Changeset package scope does not match the affected packages confidently. Changeset bump does not match the consumer-visible impact. View the proposed changeset---
'@bomb.sh/tty': minor
---
Adds synchronized output (DEC mode 2026) driven by the `sync-output` capability.
When `RuntimeCapabilities.syncOutput` is true, full-screen frames are wrapped in Begin/End Synchronized Update (`CSI ? 2026 h` / `CSI ? 2026 l`) so the terminal presents each frame as one atomic repaint without tearing. The capability is resolved from three channels: a DECRPM 2026 probe reply, an XTGETTCAP `Sync` reply, and detection-time evidence from the `Sync` extended capability in the terminfo entry or the `TMUX` environment variable. Probe replies outrank detection-time evidence in both directions. No-op frames emit nothing regardless of wrapping state; line mode output is never wrapped.
#### Migration
`Capabilities` gains a required `syncOutput` field. Object literals passed to `createTerm` as `terminfo.capabilities` must include it:
```diff
terminfo: {
capabilities: {
colors: 256,
trueColor: false,
bce: true,
autoMargin: true,
xenl: true,
altScreen: true,
styledUnderline: false,
+ syncOutput: false,
},
}
```Review this changeset manually If this draft is correct, react with 🚀 and Cooper will commit it to this branch. |
|
Size Increased — +1.6 KB 124.2 KB unpacked |
commit: |
Per the approved spec amendment (terminfo-spec §6.1/§6.3/§7.1/§7.2/§8/§9.1, renderer-spec §7.9): syncOutput is raised only on positive evidence from three channels. - Probe row 8: XTGETTCAP Sync (DCS + q 53796e63) as its own request — some terminals honor only one capability per XTGETTCAP request, so it must not merge into the RGB;Tc query. A value-carrying reply confirms; a reply naming Sync without a value denies. Sync replies never touch the colordepth tally. - Static Capabilities gains syncOutput, seeded from the Sync extended capability in the parsed terminfo entry and from TMUX environment evidence (tmux consumes mode 2026 from inner applications). - TINV-3 precedence: probe replies outrank detect-time seeding in both directions; runtimeFromStatic now flows the seeded field through. The reply's sequence value is discarded in v1: emission remains the DEC mode 2026 form, unchanged from §7.9's normative rules.
natemoo-re
marked this pull request as ready for review
October 12, 2026 01:04
cowboyd
reviewed
Oct 12, 2026
Capabilities were copied into reduce() on every render. The renderer now owns them: set_capabilities(ct, flags) stores a CAP_* bitfield on the Clayterm instance, and reduce() reads it from there. The host pushes flags at creation and again from term.update() only when a folded event changes them. init() zeroes instance state, so the native wrapper re-pushes after every re-init; a resize keeps the wrap.
input.h already defines CAP_SYNC_OUTPUT as a CapabilityEvent key (5). Any translation unit including both headers silently redefined it.
natemoo-re
force-pushed
the
feat/sync-output
branch
from
October 17, 2026 00:56
df2169b to
34ab9ca
Compare
…put field Capabilities is a public export and syncOutput is required, so object literals passed as terminfo.capabilities stop type-checking without it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements synchronized output (DEC mode 2026), previously deferred in renderer-spec §7.8.
When
RuntimeCapabilities.syncOutputis true, each full-screen frame is wrapped in BSU/ESU (CSI ? 2026 h/CSI ? 2026 l) so the terminal presents it as one atomic repaint, which prevents tearing mid-frame.