summaryrefslogtreecommitdiff
path: root/src/web/libc
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-31 03:51:34 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:08 -0300
commit32b4245962b75916be0ebe89225375430e03c36f (patch)
tree1d2ccc02338a5da4f92a9c31267468bd54bd1a4b /src/web/libc
parent6cd33661064df4163f3bd98db432526ad2165b7f (diff)
downloadpardes-32b4245962b75916be0ebe89225375430e03c36f.tar.gz
pardes-32b4245962b75916be0ebe89225375430e03c36f.zip
the capability handshake cannot lose a race it never runs
queryTerminal(2ms) blocks on a futex until DA1 comes back, and the number has to beat one terminal round trip: local answers in microseconds, ssh localhost under a millisecond, any real link never. Measured against sshd with the replies delayed to model the wire, 2ms already loses at 5ms RTT. Losing it is worse than never probing, because vaxis splits detect from enable and only detect respects the deadline. The flag flips the moment the futex times out, so the two replies gated on it — explicit width and scaled text, both spelled as a cursor-position report — stop being read as probe replies and arrive at the app as shift-F3 and alt-F3 keypresses, while the ungated ones keep mutating caps from the reader thread long after enable already declined to switch those modes on. Over ssh the terminal sat in its default modes while caps claimed otherwise: kitty keyboard was never actually pushed, ever. So send the probes and resolve them on the loop. DA1 is last and terminals answer in order, so when the reader flips the flag every earlier reply is applied — no window to miss at any latency. Verified over real ssh at 5 through 500ms RTT: 7/7 caps and kitty keyboard actually enabled at every one, where before it was 5/7 and never. Startup is 2ms faster, no golden moves (nothing answers in the harness, and with no caps enable writes no bytes). Honest scope: I could not reproduce the reported stale characters, only the handshake bug behind them. The width half of the theory is inert — vaxis's Cell.width defaults to 1 and pardes writes one codepoint per cell with an explicit spacer, so gwidth, the only consumer of caps.unicode, is never called. That is written down so nobody re-derives it. If the dirty screen survives, the next suspect is vaxis's own carry-over for an escape sequence split across a read boundary (Loop.zig:174-190, wrong length and an off-by-one): four wheel events sent whole scroll four notches, the same four split at a `;` with a 60ms gap scroll zero. Network framing is exactly what makes those gaps. It is an input bug in a vendored dep and wants its own change.
Diffstat (limited to 'src/web/libc')
0 files changed, 0 insertions, 0 deletions