hermes-agent/ui-tui/src
0xbyt4 3504bd401b fix(tui): route Ctrl+B to voice toggle, not composer input
When the user runs /voice and then presses Ctrl+B in the TUI, three
handlers collaborate to consume the chord and none of them dispatch
voice.record:

- isAction() is platform-aware — on macOS it requires Cmd (meta/super),
  so Ctrl+B fails the match in useInputHandlers and never triggers
  voiceStart/voiceStop.
- TextInput's Ctrl+B pass-through list doesn't include 'b', so the
  keystroke falls through to the wordMod backward-word branch on Linux
  and to the printable-char insertion branch on macOS — the latter is
  exactly what timmie reported ("enters a b into the tui").
- /voice emits "voice: on" with no hint, so the user has no way to
  know Ctrl+B is the recording toggle.

Introduces isVoiceToggleKey(key, ch) in lib/platform.ts that matches
raw Ctrl+B on every platform (mirrors tips.py and config.yaml's
voice.record_key default) and additionally accepts Cmd+B on macOS so
existing muscle memory keeps working. Wires it into useInputHandlers,
adds Ctrl+B to TextInput's pass-through list so the global handler
actually receives the chord, and appends "press Ctrl+B to record" to
the /voice on message.

Empirically verified with hermes --tui: Ctrl+B no longer leaks 'b'
into the composer and now dispatches the voice.record RPC (the
downstream ImportError for hermes_cli.voice is a separate upstream
bug — follow-up patch).
2026-04-23 16:18:15 -07:00
..
__tests__ fix(tui): route Ctrl+B to voice toggle, not composer input 2026-04-23 16:18:15 -07:00
app fix(tui): route Ctrl+B to voice toggle, not composer input 2026-04-23 16:18:15 -07:00
components fix(tui): route Ctrl+B to voice toggle, not composer input 2026-04-23 16:18:15 -07:00
config chore(tui): /clean pass — inline one-off locals, tighten ConfirmPrompt 2026-04-19 07:55:38 -05:00
content fix(tui): input wrap width mismatch — last letter no longer flickers 2026-04-22 15:27:54 -05:00
domain refactor(ui-tui): clean touched resize and sticky prompt paths 2026-04-23 14:37:00 -05:00
hooks fix(tui): address PR #13231 review comments 2026-04-20 19:09:09 -05:00
lib fix(tui): route Ctrl+B to voice toggle, not composer input 2026-04-23 16:18:15 -07:00
protocol refactor(tui): /clean pass across ui-tui — 49 files, −217 LOC 2026-04-16 22:32:53 -05:00
types fix(tui): improve macOS paste and shortcut parity 2026-04-21 08:00:00 -07:00
app.tsx refactor(tui): store-driven turn state + slash registry + module split 2026-04-16 12:34:45 -05:00
banner.ts refactor(tui): /clean pass across ui-tui — 49 files, −217 LOC 2026-04-16 22:32:53 -05:00
entry.tsx fix(tui): drop main-screen banner flash, widen alt-screen clear on entry 2026-04-22 15:27:54 -05:00
gatewayClient.ts fix(tui): address PR #13231 review comments 2026-04-20 19:09:09 -05:00
gatewayTypes.ts refactor(tui): statusbar as 4-mode position (on|off|bottom|top) 2026-04-22 15:27:54 -05:00
theme.ts feat(tui): subagent spawn observability overlay 2026-04-22 10:38:17 -05:00
types.ts feat(tui): subagent spawn observability overlay 2026-04-22 10:38:17 -05:00