Skip to content

fix(tui): readline parity on Linux — Ctrl+A = home, Alt+B/F word nav#13594

Merged
OutThisLife merged 1 commit into
mainfrom
bb/tui-readline-parity-linux
Apr 21, 2026
Merged

fix(tui): readline parity on Linux — Ctrl+A = home, Alt+B/F word nav#13594
OutThisLife merged 1 commit into
mainfrom
bb/tui-readline-parity-linux

Conversation

@OutThisLife

@OutThisLife OutThisLife commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

From TUI blitz-test feedback: "Standard readline keys (Ctrl+A … Ctrl+K … Ctrl+W) seem not to work" / "Using ctrl-a to jump to start of line highlights all the text input" / "Some terminal navigation shortcuts that I expect don't work, such as Alt+B to navigate 'back a word'."

Summary

textInput treated the platform action-mod (Cmd on macOS, Ctrl on Linux) as the sole word-boundary modifier. On Linux that meant:

  • Ctrl+A selected all instead of jumping to line start, contrary to standard readline and the hotkey table already in ui-tui/README.md (which documents Ctrl+A = Start of line).
  • Alt+B / Alt+F / Alt+Backspace / Alt+Delete were dropped — key.meta was never consulted, even though the README already documents Meta+B / Meta+F as word nav.

Fix:

  • Gate select-all to macOS Cmd+A (isMac && mod && inp === 'a'), route Linux Ctrl+A through actionHome.
  • Broaden every word-boundary predicate (b/f/Backspace/Delete and modified arrow keys) from mod to wordMod = mod || k.meta so Alt chords work on Linux and Mac while existing Ctrl/Cmd chords keep working.

Test plan

  • npm run type-check clean
  • npm test — 152/152 pass
  • Manual (Linux): Ctrl+A = line start, Ctrl+E = line end, Ctrl+K/U/W delete as before
  • Manual (Linux): Alt+B / Alt+F move by word, Alt+Backspace / Alt+Delete kill word
  • Manual (Mac): Cmd+A still selects all, Option+B/F still word nav

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adjusts TextInput key handling to match standard readline expectations on Linux while preserving macOS behaviors.

Changes:

  • Routes Linux Ctrl+A to “start of line” instead of “select all”.
  • Enables word navigation/deletion via Meta (Alt/Option) by broadening word-modifier detection (wordMod).
  • Updates arrow-key word movement and delete-word behaviors to respect the new word-modifier.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui-tui/src/components/textInput.tsx
@OutThisLife

Copy link
Copy Markdown
Collaborator Author

On the Copilot comment re: Option+A on macOS — that's a pre-existing ambiguity in isActionMod (Option and Cmd both surface as meta on legacy Mac terminals; kitty separates them via super). Before this PR, mod && inp === 'a' fired select-all for both anyway, so this PR doesn't regress anything. Proper fix would prefer k.super when present but fall back to meta for terminals that don't send super — out of scope here; leaving as a separate cleanup.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

textInput treated the platform action-mod (Cmd on macOS, Ctrl on Linux)
as the sole word-boundary modifier. On Linux that meant:

- Ctrl+A selected all instead of jumping to line start (contra standard
  readline and the hotkey doc in README.md which says `Ctrl+A` = Start
  of line).
- Alt+B / Alt+F / Alt+Backspace / Alt+Delete were dropped, because
  `key.meta` was never consulted — the README already documented
  `Meta+B` / `Meta+F` as word nav.

Gate select-all to macOS Cmd+A (`isMac && mod && inp === 'a'`), route
Linux Ctrl+A through `actionHome`, and broaden every word-boundary
predicate (b/f/Backspace/Delete and the modified arrow keys) from `mod`
to `wordMod = mod || k.meta` so Alt chords work on Linux and Mac while
existing Ctrl/Cmd chords keep working.
@OutThisLife OutThisLife force-pushed the bb/tui-readline-parity-linux branch from 5affa06 to d86c886 Compare April 21, 2026 19:30
@alt-glitch alt-glitch added type/bug Something isn't working comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Apr 21, 2026
@OutThisLife OutThisLife merged commit 5b60ef8 into main Apr 21, 2026
9 of 10 checks passed
@OutThisLife OutThisLife deleted the bb/tui-readline-parity-linux branch April 21, 2026 21:40
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
…ne-parity-linux

fix(tui): readline parity on Linux — Ctrl+A = home, Alt+B/F word nav
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
…ne-parity-linux

fix(tui): readline parity on Linux — Ctrl+A = home, Alt+B/F word nav
Luminet2023 pushed a commit to Luminet2023/hermes-agent that referenced this pull request May 1, 2026
…ne-parity-linux

fix(tui): readline parity on Linux — Ctrl+A = home, Alt+B/F word nav
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…ne-parity-linux

fix(tui): readline parity on Linux — Ctrl+A = home, Alt+B/F word nav
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…ne-parity-linux

fix(tui): readline parity on Linux — Ctrl+A = home, Alt+B/F word nav
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…ne-parity-linux

fix(tui): readline parity on Linux — Ctrl+A = home, Alt+B/F word nav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants