Skip to content

[feat] Ctrl-b doesn't work for CC #3994

Closed as duplicate
Closed as duplicate

Description

@kevinlu-datacurve

Describe the feature

When I click ctrl-b for enter background mode in CC, nothing happens.

Activity

  1. github-actions commented on May 2, 2026

    @github-actions
    Contributor

    Tried to reproduce this and traced the keyboard path end-to-end; couldn't find a code path in the desktop app that swallows plain Ctrl+B.

    What I checked:

    • Hotkey registry (apps/desktop/src/renderer/hotkeys/registry.ts) — TOGGLE_WORKSPACE_SIDEBAR is bound to meta+b on macOS and ctrl+shift+b on Windows/Linux. Plain ctrl+b is not a registered chord on any platform.
    • Terminal key event handler (apps/desktop/src/renderer/lib/terminal/terminal-key-event-handler.ts) — resolveHotkeyFromEvent returns null for unregistered chords, and the handler then returns true (passes the event to xterm) for Ctrl+B. None of the line-edit / select-all / clipboard branches match it either.
    • xterm encoder (@xterm/xterm v6, with vtExtensions: { kittyKeyboard: true }) — kitty mode is gated on flags > 0, and the flags only become non-zero when an application sends CSI > N u. By default the legacy encoder runs, which encodes Ctrl+B (keyCode 66) as String.fromCharCode(66 - 64) = \x02. That's exactly the byte Claude Code expects for background mode.
    • PTY forwarding — xterm.onData is wired to handleTerminalInput in useTerminalLifecycle.ts (and to the WS transport in v2), which calls writeRef.current({ paneId, data }) to forward bytes to the PTY.

    I also wrote a quick repro test that fired a Ctrl+B KeyboardEvent through createTerminalKeyEventHandler on MacIntel / Win32 / Linux x86_64 — the handler returned true (no swallow) on all three, and didn't call preventDefault or xterm.input. So the chord reaches xterm's encoder, which sends \x02 to the PTY.

    A few possibilities that would explain the symptom outside this codebase:

    1. A multiplexer between Superset and Claude Code — tmux uses Ctrl+B as its prefix key by default, so if Claude Code is running inside tmux, tmux eats it. screen (Ctrl+A prefix), zellij, etc. can do similar things.
    2. A user hotkey override binding something to ctrl+b in Settings → Keyboard. The override store would put ctrl+b in registeredAppChords, which would make the terminal handler swallow it.
    3. A different chord than I'm assuming — could you confirm whether you're pressing literal Ctrl+B (the Control key) or Cmd+B on macOS? Cmd+B is bound to Toggle Workspaces Sidebar on macOS, which would intercept it.

    If you can share platform (macOS / Windows / Linux), whether anything is wrapping the shell (tmux/screen/etc.), and whether you've customized hotkeys in Settings → Keyboard, I'm happy to dig further.

  2. Kitenite commented on May 2, 2026

    @Kitenite
    Member

    HI i can't reproduce ctrl+b in ghostty for background claude code could you share claude version?

  3. Kitenite commented on Jul 11, 2026

    @Kitenite
    Member

    Closing as a duplicate of #5604, the consolidated tracker for stale terminal-input issues from the July 2026 stale-issue sweep (no activity since 2026-06-01). If this still applies on a current build, comment on #5604 and we'll reopen.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions