Repository navigation
Description
Summary
In the integrated terminal on macOS, the standard line-editing shortcuts do nothing useful. Cmd+Left and Cmd+Right do not move the cursor to the start or end of the line, and Cmd+Backspace deletes one character instead of the line. I expected them to behave as they do in VS Code's terminal and in iTerm2's "Natural Text Editing" preset.
Versions and environment
- bb 0.44.0 (desktop app), macOS 27.0.1
- Code read at
maincommit 1b973d5
Steps to reproduce
- Open a thread and open a Terminal tab.
- Type
echo hello worldwithout pressing Enter. - Press Cmd+Left, then Cmd+Right, then Cmd+Backspace.
- Type
echo hello worldagain and press Option+Left.
Expected vs actual
| Keys | Expected | Actual |
|---|---|---|
| Cmd+Left | Cursor moves to start of line | Nothing happens |
| Cmd+Right | Cursor moves to end of line | Nothing happens |
| Cmd+Backspace | Deletes to start of line | Deletes one character |
| Cmd+Delete (forward delete) | Deletes to end of line | Not checked in the app |
| Option+Left / Option+Right | Cursor moves one word | Not checked in the app |
Cmd+Left, Cmd+Right and Cmd+Backspace were observed in the desktop app. The other rows are what the code implies and have not been checked live.
Evidence
- bb creates the terminal without a custom key handler, so every key goes through xterm.js's default translation:
bb/apps/app/src/components/thread/terminal/ThreadTerminalView.tsx
Lines 916 to 925 in 1b973d5
terminal = new Terminal({ allowProposedApi: TERMINAL_ALLOW_PROPOSED_API, convertEol: true, cursorBlink: true, fontFamily: readTerminalFontFamily(), fontSize: 12, linkHandler: osc8LinkHandler, scrollback: 10_000, theme: buildTerminalTheme(), }); - xterm.js (
@xterm/xterm6.1.0-beta.292,src/common/input/Keyboard.ts) sends nothing for an arrow key while Cmd is held, and ignores Cmd for Backspace, so Cmd+Backspace sends the same byte as Backspace. - For Option+Left/Right xterm.js sends
ESC [1;3D/ESC [1;3C, not theESC b/ESC fthat shells bind to word movement by default. - Found in bb thread
thr_nttab8umdq.
What you ruled out
- Not Terminal has no clear command: Cmd+K does nothing, and neither keyboard settings nor a plugin can add it #3570: that asks for a Cmd+K clear command. Same root cause (no key handler), different keys. A fix here adds the key handler that Terminal has no clear command: Cmd+K does nothing, and neither keyboard settings nor a plugin can add it #3570 and Support copy-and-paste keyboard shortcuts in the integrated terminal #3341 could build on.
- Not Support copy-and-paste keyboard shortcuts in the integrated terminal #3341: that asks for copy and paste shortcuts.
- Not fixable with Settings → Keyboard or a plugin: there is no command to rebind, and plugins cannot register terminal key handling (see Terminal has no clear command: Cmd+K does nothing, and neither keyboard settings nor a plugin can add it #3570).
Suggested priority and effort (optional)
Medium — affects every macOS user who edits commands in the terminal; the workaround is Ctrl+A / Ctrl+E / Ctrl+U. Effort Low.
AGENT GENERATED
Activity
bb-slop-cop commentedon Oct 2, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotui,partial-repro.