fix(tui): make steer, escape, enter, and double ctrl-c work under extended-keys#31
Merged
Merged
Conversation
…ended-keys The interactive control plane did not reliably drive a running turn. A typed steer only took effect at the next iteration boundary, and Escape, Enter, and Ctrl-C did nothing under terminals using the extended-keys (CSI-u) keyboard protocol, where those keys arrive as ESC[27u, ESC[57414u (kitty functional Enter) or ESC[13u, and ESC[99;5u key sequences rather than a bare byte or an OS signal. - steer: typing during a turn now cancels the in-flight turn at once and runs the queued text as the next turn; the queued note is highlighted in cyan. A sticky abort flag closes the between-iteration window where a cancel was previously dropped, so Escape aborts the judge and worker phases too. - escape: detection keys off the sequence introducer rather than a fragile timer, and the CSI-u Escape (ESC[27u) is decoded and routed to cancel. - enter: the CSI-u Enter (codepoint 13 or kitty functional 57414) is normalized back to a plain Return so the one submit/steer path handles it; a modified Enter still inserts a newline. - ctrl-c: force-exit no longer blocks on the kill grace period; the CSI-u Ctrl-C (ESC[99;5u) and a raw 0x03 are routed to the same quit path as the OS signal, so a double press exits even under extended-keys. - add a /stop command (the typed twin of Escape) and an opt-in SESH_DEBUG trace of the control-plane events. The proc tool now threads the turn context so it shares bash's cancellable contract.
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.
Closes #30.
The interactive control plane did not reliably drive a running turn: a typed steer only took effect at the next iteration boundary, and Escape, Enter, and Ctrl+C did nothing under terminals using the extended-keys (CSI-u) keyboard protocol (e.g. tmux with
extended-keys on). In that mode those keys arrive as key sequences through the input stream rather than a bare byte or an OS signal, so the existing handlers never saw them:ESC[27uESC[57414u(kitty functional) orESC[13uESC[99;5u(never delivered as SIGINT)What changed
[/O) rather than a fragile timer, and the CSI-u Escape (ESC[27u) is decoded and routed to cancel.ESC[99;5u) and a raw0x03are routed to the same quit path as the OS signal, so a double press exits even under extended-keys.proctool now threads the turn context so it shares bash's cancellable contract.Verification
gofmt,go vet,go build ./...,go test ./...all clean; race detector clean on the touched packages./stop, no-block force-exit), each with a nameable one-line breaker.extended-keys on): steer, Escape, Enter,/stop, and double Ctrl+C all confirmed working; the exact key sequences were captured during debugging and pinned by the decode helpers.agent/is untouched; all changes live inharness/.