Time each late key to the console by hand-off; a keystroke no longer waits in the input pipe for the next one (SES-354) #62
Loading…
Reference in a new issue
No description provided.
Delete branch "att-key-arrival"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Typing on nelsonpc is choppy: keys reach tmux in bursts, a median ~70 ms and up to 1.7 s after the press, while the program answers within 1-2 ms of tmux reading the key and tmux's client never waits on its console writes. So the time goes between the press and the tmux client reading the key from at-terminal's console, and nothing timed that stretch. Work package: https://openproject.home.romaine.life/wp/SES-354 (from https://openproject.home.romaine.life/wp/SES-337, https://openproject.home.romaine.life/wp/TMUX-266).
Added: each late key's time, split by hand-off (Windows only). The window's message hook keeps the last press (its time from
MSG::time, and how long the window's thread had taken no message); the key handler hands it on with the bytes it queues (teletypewriter::key_trace::sent); the input pipe's worker marks when they were written into the console's pipe. A press whose bytes reach the pipe 25 ms or more after it happened (the typing budget, at-home-toolsdocs/typing-latency.md) is counted, and once a second at most at-terminal's log sayskeys reached the console late count= worst_ms= window_ms= idle_ms= handler_ms= pipe_ms=. With tmux's key trace (read), whatever remains is the console host and the client.Fixed: a keystroke could wait in the input pipe for the next one. The pipe worker checked for bytes outside the lock the writer notifies under, so bytes arriving between its check and its wait never woke it; they sat until the next write. It now checks under that lock, and the writer and
Dropnotify under it.Replaced: this branch's earlier
keys reached the window lateline, which timed only the press to the window: its numbers arewindow_msandidle_mshere.Not changed: how keys are encoded or written, frames, Linux and macOS.
Tests:
key_trace's two unit tests; atlog's line tests updated for the new fields;cargo clippy -j 4on teletypewriter, rio-window and rioterm.🤖 Generated with Claude Code
merge-queue stopped this at
612e5b8: CI failed: Suite rust / check-test-linux (pull_request). Push a fix. A failure fixed on main lands once thequeuelabel is removed and added again: the queue merges main in and CI runs on the new head.