Allow disabling the left-arrow detach-to-background gesture (not rebindable via keybindings.json)
Feature request
Make the left-arrow "detach to background" gesture disableable (setting or rebindable keybinding action).
Problem
Pressing ← on an empty chat input while attached to a background/agent session triggers a detach gesture: first press arms ("Press ← again" / "Ambiguous ←, press again to detach"), a second press within 3s detaches and forks the session to background (SessionStart fires with source: "fork").
For users who never use this gesture deliberately, accidental double-taps or key auto-repeat fire it constantly. It interrupts foreground work mid-workflow, and it is easy to not notice the detach happened — the workflow appears dead/unresumable to the user even though the background session is still running.
Why keybindings.json cannot fix it
The gesture is implemented inside the text-input handler (onLeftArrowOnEmpty), not via the keybinding table. Unbinding left in every context that binds it (Tabs, Footer, Attachments, DiffDialog, ModelPicker) in ~/.claude/keybindings.json has no effect on the detach gesture. There is also no settings.json key or env var for it (checked strings of the 2.1.223 binary and the changelog through 2.1.222; 2.1.218 added the post-editing confirm guard, which helps but does not allow opting out).
Proposed solutions (any of these would work)
- A settings.json option, e.g.
"disableLeftArrowDetach": true. - Expose the gesture as a real keybinding action (e.g.
chat:detachOnEmpty) so it can be rebound or set tonulllike any other binding. - Respect an existing unbind of
leftin a relevant context as an opt-out.
Environment
- Claude Code 2.1.223, Linux (Debian), bash
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗