Skip to content

Terminal ignores standard macOS line-editing shortcuts (Cmd+Left/Right, Cmd+Backspace, Option+Left/Right) #4759

Open

Description

@robennals

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 main commit 1b973d5

Steps to reproduce

  1. Open a thread and open a Terminal tab.
  2. Type echo hello world without pressing Enter.
  3. Press Cmd+Left, then Cmd+Right, then Cmd+Backspace.
  4. Type echo hello world again 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:
    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/xterm 6.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 the ESC b / ESC f that shells bind to word movement by default.
  • Found in bb thread thr_nttab8umdq.

What you ruled out

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

  1. added theissue type on Oct 2, 2026
  2. added
    ui
    partial-repro
    on Oct 2, 2026
  3. bb-slop-cop commented on Oct 2, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority Medium · Effort Low; labels ui, partial-repro.
    • Reproduction and root-cause report: PARTIALLY REPRODUCED, with high confidence in the Command-key root cause.
    • Root cause: BB installs no macOS editing override, so xterm emits no input for Command arrows and ordinary DEL for Command+Backspace. The normal input path forwards those bytes unchanged.
    • Verification: repeated keyboard-event and real Bash Readline reproductions using two clean trusted-main checkouts. Command editing fails; Option arrows already move words in the tested Bash defaults. Native macOS desktop and zsh remain unverified.
    • No new PR: existing open #4760 already links this issue; opening another would duplicate the fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    partial-reproui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions