Repository navigation
fix(tui): use matchesKey for Ctrl+C in pickers to support modern keyboard protocols - #136239
aniruddhaadak80 wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed September 2, 2026, 12:39 PM ET / 16:39 UTC. ClawSweeper reviewWhat this changesThe PR changes two TUI picker input handlers to recognize Ctrl+C through the shared normalized key matcher rather than only the legacy ETX byte. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked until real behavior proof is added - 5 items remain Keep this PR open: it is a focused repair, but the prior request for normalized Ctrl+C coverage remains unmet and no after-fix terminal/PTY evidence proves the advertised modern encodings. Priority: P2 Review scores
Verification
How this fits togetherModel, agent, context, and session pickers receive decoded terminal input and use cancellation callbacks to close their overlay. The session picker also clears an active filter before cancellation. flowchart LR
A[Terminal keyboard input] --> B[Key decoder]
B --> C[Picker input handler]
C --> D{Escape or Ctrl+C}
D --> E[Clear session filter]
D --> F[Cancel picker]
F --> G[Close TUI overlay]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +2. Total +2 across 2 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the direct normalized matcher, add table-driven legacy/Kitty/modifyOtherKeys cases for both picker semantics, and attach a redacted after-fix native terminal or PTY trace. Do we have a high-confidence way to reproduce the issue? No. The linked issue provides a concrete native PTY scenario, but this review did not execute it and the pi-tui decoder contract was unavailable for direct inspection. Is this the best way to solve the issue? Unclear. The replacement matches the repository's existing normalized Ctrl+C pattern, but the dependency contract, focused protocol coverage, and after-fix behavior proof are still missing. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1623683f478b. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
1b835f3 to
b6eebdf
Compare
…oard protocols
Replace raw ETX byte comparison (\u0003) with matchesKey(keyData, Key.ctrl('c'))
in FilterableSelectList and SearchableSelectList. This fixes Ctrl+C cancellation
not working with Kitty CSI-u and xterm modifyOtherKeys keyboard encodings while
preserving backward compatibility with legacy ETX byte input.
Closes openclaw#133128
b6eebdf to
e82b36f
Compare
|
Thanks @aniruddhaadak80. The same Ctrl+C decoding failure from #133128 is now fixed by #133151, merged as The recorded native TUI proof passes all eight model/session cases across Escape, legacy Ctrl+C, Kitty CSI-u, and xterm modifyOtherKeys. Each case returns to chat, sends a prompt, receives its synthetic backend reply, and exits cleanly. The existing model/session selection flow also passes. This proof exercises the real TUI in PTYs with a synthetic backend. Your contribution is preserved in #133151's description and its |
What Problem This Solves
Fixes an issue where Ctrl+C does not cancel TUI model, agent, and session pickers when the terminal sends Kitty CSI-u or xterm modifyOtherKeys input instead of the legacy ETX byte.
Why This Change Was Made
The existing code used raw ETX byte comparison (\u0003) for Ctrl+C detection. Modern terminals that use Kitty keyboard protocol (CSI-u) or xterm modifyOtherKeys mode send different encodings for Ctrl+C, causing the raw comparison to silently fail.
The fix replaces the raw byte comparison with \matchesKey(keyData, Key.ctrl('c')), which is the pi-tui decoder that handles all keyboard encoding protocols transparently. This is the same pattern already used in \custom-editor.ts\ for Ctrl+C handling.
User Impact
Operators using terminals with Kitty CSI-u or xterm modifyOtherKeys input can now cancel TUI pickers with Ctrl+C. The fix is backward-compatible with legacy ETX byte input.
Evidence
Closes #133128