hermes-agent/ui-tui/src/lib
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
..
circularBuffer.ts fix(tui): address PR #13231 review comments 2026-04-20 19:09:09 -05:00
clipboard.ts fix(tui): raise picker selection contrast with inverse + bold 2026-04-21 14:31:21 -05:00
emoji.ts fix(tui): inject VS16 so text-default emoji render as color glyphs 2026-04-21 15:52:39 -05:00
externalCli.ts feat(tui): /model and /setup slash commands with in-place CLI handoff 2026-04-17 10:58:18 -05:00
gracefulExit.ts refactor(tui): /clean pass on memory + resize helpers 2026-04-20 18:58:44 -05:00
history.ts refactor(tui): /clean pass across ui-tui — 49 files, −217 LOC 2026-04-16 22:32:53 -05:00
memory.ts fix(tui): address PR #13231 review comments 2026-04-20 19:09:09 -05:00
memoryMonitor.ts refactor(tui): /clean pass on memory + resize helpers 2026-04-20 18:58:44 -05:00
messages.ts refactor(tui): /clean pass across ui-tui — 49 files, −217 LOC 2026-04-16 22:32:53 -05:00
osc52.ts fix(tui): raise picker selection contrast with inverse + bold 2026-04-21 14:31:21 -05:00
platform.ts fix(tui): route Ctrl+B to voice toggle, not composer input 2026-04-23 16:18:15 -07:00
reasoning.ts fix(tui): strip <think>…</think> tags from assistant content and route to reasoning panel 2026-04-18 14:46:38 -05:00
rpc.ts fix(tui): slash.exec _pending_input commands, tool ANSI, terminal title 2026-04-18 09:30:48 -07:00
subagentTree.ts refactor(tui): consolidate agents overlay — share duration/root helpers via lib 2026-04-22 12:10:21 -05:00
syntax.ts feat(tui): per-language syntax highlighting in markdown code fences 2026-04-18 09:48:38 -05:00
terminalParity.ts fix(tui): raise picker selection contrast with inverse + bold 2026-04-21 14:31:21 -05:00
terminalSetup.ts fix(tui): raise picker selection contrast with inverse + bold 2026-04-21 14:31:21 -05:00
text.test.ts fix: clean newline paste thingy 2026-04-13 12:54:48 -05:00
text.ts fix(cli): keep snake_case underscores intact in strip markdown mode 2026-04-21 15:32:59 -03:00