aboutsummaryrefslogtreecommitdiffstats
path: root/src/jsonval.c
diff options
context:
space:
mode:
authoruser <user@clank>2026-10-09 12:24:48 +0200
committeruser <user@clank>2026-10-09 12:31:53 +0200
commitfcf305085343bcb5c5240ed642468461f247f1ed (patch)
treeda00e12658bc22fee0e9f25e634572cf2aec9b53 /src/jsonval.c
parenttab bar: a sidebar that fits the terminal, and gives up the edge last (diff)
downloadslosh-fcf305085343bcb5c5240ed642468461f247f1ed.tar.gz
slosh-fcf305085343bcb5c5240ed642468461f247f1ed.tar.xz
slosh-fcf305085343bcb5c5240ed642468461f247f1ed.zip
osc 7501: say what you are doing in somebody else's protocol
OSC 5577 only works for programs that know slosh exists. The program status protocol is the same idea written down for everybody, by ghostty's author and implemented by ghostty and Rex, so a program that already speaks it needs to know nothing about us: printf '\033]7501;state=working:app=cargo:msg=YnVpbGRpbmc=\033\\' Implemented *as well as* 5577, not instead of it. 5577 is a two-way control channel -- buttons answer on the program's stdin, shaders are refused with a reason -- and 7501 deliberately is not, so neither absorbs the other. What 7501 buys is the programs we do not control. The scanner becomes one pass for four things: 5577, 7501, OSC 133 ; A and RIS. The last two are here because 7501 ties record lifetime to them -- a new prompt or a full reset is how a stale `working` dies without a heartbeat -- and because a pane should pay for that scan once. osc5577_fn gives way to osc_scan_cbs_t. Reports are all-or-nothing, which is the spec's rule: no state, an unknown state, a broken limit, base64 that will not decode, a control character in decoded text or a malformed id discards the whole report rather than writing a partial one. A malformed *pair* is skipped and the rest parsed. A pane keeps up to PANE_PS_MAX records with LRU eviction, and composes the one line it has from them by precedence -- blocked, error, done, working, idle -- resolving `app` from the nearest ancestor that has one, the way the hierarchy is allowed to mean something. It lands in the slot 5577's `status` already had, because every reader of a pane wants "what is this doing", not "which protocol said so"; `panes` reports program_state, program_kind, program_app and progress beside it, with -1 for a progress nobody reported, since a bar drawn at 0% says something false. The feature-detection reply is rate-limited here. Note for the next re-vendor: upstream lib-vt implements 7501 too, newer than our pin, and answers the support query itself through write_pty without rate-limiting it. See "What upstream did" under D1 in DESIGN.md before swapping this half of the file for GHOSTTY_TERMINAL_OPT_PROGRAM_STATUS.
Diffstat (limited to 'src/jsonval.c')
0 files changed, 0 insertions, 0 deletions