Skip to content

feat(tui): route shell shortcuts through opentui keymap - #1460

Merged
TheGreatAxios merged 5 commits into
mainfrom
cl-10734-adopt-opentuikeymap-for-shell-shortcuts
Oct 17, 2026
Merged

TheGreatAxios merged 5 commits into
mainfrom
cl-10734-adopt-opentuikeymap-for-shell-shortcuts

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Shell application shortcuts are @opentui/keymap commands. OpenTUI is 0.6.6, which is the release that package tracks.
  • Cursor motion, word motion, and delete stay on the Textarea defaults. The hand-rolled copies of those chords are gone.
  • Ctrl+K, Ctrl+U, Ctrl+W, and Alt+D still edit the prompt after Tab moves focus to the transcript. The scroll lease, yank, and Ctrl+C's pause-then-quit sequence stay, because OpenTUI does not implement them.

Verification

  • bun run check passes (9095 tests, 0 fail)
  • bun test ./src/tui/keybindings.test.ts ./src/tui/focus-routing.test.ts ./src/tui/prompt-kill-ring.test.ts --randomize --seed 424242 passes (32 tests)

Fixes CL-10734

@linear-code

linear-code Bot commented Oct 16, 2026

Copy link
Copy Markdown

CL-10734

@corbits-triage

corbits-triage Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review · Comment

Application chords, transcript kills, and the destroy unsubscribe go through @opentui/keymap 0.6.6. No behavior defect in the branch diff.

Findings

No defects. These comments narrate or misstate the code:

  • src/tui/shell/keymap.ts:3 — "There is no second switch from key name to handler."
  • src/tui/shell/keymap.ts:93 — restates shellKeymapListening.
  • src/tui/keybindings.ts:6 — "There is no second copy of the application chord table here."
  • src/tui/keybindings.ts:83 — says setAppShortcutRows is called again from the live keymap. The only call is the import-time one in keymap.ts.
  • src/tui/keybindings.ts:96 — says application rows are whatever the keymap registered. shellShortcuts returns the import-time appRows snapshot.
  • docs/TUI-keymap-eval.md:9 — says createDefaultOpenTuiKeymap(renderer) installs the parser. The shell builds new Keymap(guardHost(renderer)) itself.

Notes

  • pokeShellKeymapPress is a test hook for the destroy unsubscribe. Leave it if that test still needs it.
  • Merge is blocked until this branch rebases cleanly onto main. Triage already failed on conflicts.

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review · Approve

Application chords go through @opentui/keymap. The rebase keeps the textarea kill on a focused prompt, kills prompt text while the transcript is focused, and parks the caret with removedByDelete.

No findings.

@TheGreatAxios
TheGreatAxios merged commit 25998b8 into main Oct 17, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant