gemini-cli - 💡(How to fix) Fix Restore Ctrl+B to 'cursor.left' (backward-char) by default in Unix environments

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

In Unix-like terminal environments and standard Emacs-style keybindings, Ctrl+B is universally used and expected to perform backward-char (moving the cursor one character to the left).

However, in gemini-cli, Ctrl+B is hardcoded to background.toggle ("Toggle current background shell visibility"). This application-level override breaks the muscle memory of Unix/Readline power users, creating a disjointed typing experience (since Ctrl+F properly moves the cursor forward by default, but Ctrl+B does not move it backward).

Root Cause

In Unix-like terminal environments and standard Emacs-style keybindings, Ctrl+B is universally used and expected to perform backward-char (moving the cursor one character to the left).

However, in gemini-cli, Ctrl+B is hardcoded to background.toggle ("Toggle current background shell visibility"). This application-level override breaks the muscle memory of Unix/Readline power users, creating a disjointed typing experience (since Ctrl+F properly moves the cursor forward by default, but Ctrl+B does not move it backward).

Code Example

[
  {
    "command": "-background.toggle",
    "key": "ctrl+b"
  },
  {
    "command": "cursor.left",
    "key": "ctrl+b"
  }
]
RAW_BUFFERClick to expand / collapse

Description

In Unix-like terminal environments and standard Emacs-style keybindings, Ctrl+B is universally used and expected to perform backward-char (moving the cursor one character to the left).

However, in gemini-cli, Ctrl+B is hardcoded to background.toggle ("Toggle current background shell visibility"). This application-level override breaks the muscle memory of Unix/Readline power users, creating a disjointed typing experience (since Ctrl+F properly moves the cursor forward by default, but Ctrl+B does not move it backward).

Proposed Solutions

While users can customize this by editing ~/.gemini/keybindings.json:

[
  {
    "command": "-background.toggle",
    "key": "ctrl+b"
  },
  {
    "command": "cursor.left",
    "key": "ctrl+b"
  }
]

To improve the out-of-the-box developer experience, we propose:

  1. Change the Default: Change the default keybinding for toggling the background shell to a non-conflicting key combination (e.g., Ctrl+\\ or Ctrl+Alt+B), and restore Ctrl+B to cursor.left by default.
  2. Opt-in Unix/Readline Preset: Provide a simpler setting/preset to fully respect GNU Readline standards without manual keybinding JSON configuration.

Client Environment

  • OS: macOS / Linux (All Unix environments)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING