Expand description
Render-commit marker.
The adapter writes this OSC sequence to stdout after the last byte of the render belonging to revision N. It commits a frame; it never carries data.
OSC 8487 ; twm;<revision>;<mac> BELOSC rather than DCS because ConPTY rewrites the stream it forwards: a passthrough probe showed it dropping DCS, APC and OSC 8 while passing private OSC with either terminator, so a DCS marker could not reach the driver on Windows at all.
with mac = base64url(HMAC-SHA256(token, "{session_id}:{revision}"))[..16],
unpadded. The token is an opaque UTF-8 string end to end: whatever arrives
in TERMWRIGHT_TOKEN is used as key bytes, never decoded first.
Structs§
- Render
Marker - A verified marker: the revision it commits, and the MAC that proved it.
Constants§
- MARKER_
MAC_ BYTES - How much of the HMAC-SHA256 output the marker retains.
- MARKER_
OSC_ CODE - The private OSC number carrying render-commit markers. Chosen clear of
everything in use (xterm’s allocations, OSC 8, 9, 99, 133, 633, 697, 777+):
84 and 87 are the ASCII codes of
TandW, for termwright. - MARKER_
OSC_ PREFIX - The tag opening a marker payload, immediately after
OSC 8487;. A self-identifying guard: if anything ever claims 8487, a marker still says what it is rather than being mistaken for that feature’s payload. - MAX_
SAFE_ INTEGER - Largest revision that survives a round trip through the JavaScript reference implementation unchanged.
Functions§
- compute_
mac - Compute the marker MAC for a session and revision.
- encode_
marker - Build the full escape sequence committing
revision. - verify_
marker_ payload - Parse and verify an OSC payload — everything after
OSC 8487;.