gemini-cli - 💡(How to fix) Fix Bug Report: Shift+Tab does not work on Windows to switch between Plan/Act modes [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

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…
GitHub stats
google-gemini/gemini-cli#25584Fetched 2026-04-18 05:57:41
View on GitHub
Comments
2
Participants
3
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2closed ×1

On Windows, pressing Shift+Tab to switch between Plan and Act modes has no effect. The UI does not respond at all.

Root Cause

Root Cause Investigation

Fix Action

Workaround

Currently the only workaround is to run Gemini CLI inside WSL, where Shift+Tab correctly sends \x1b[Z.

Code Example

process.stdin.setRawMode(true);
process.stdin.resume();
process.stdin.on('data', (buf) => {
  console.log('hex:', buf.toString('hex'));
});

---

{ sequence: '\t', name: 'tab', ctrl: false, meta: false, shift: false }

---

> /about
# paste output here
RAW_BUFFERClick to expand / collapse

What happened?

Environment

  • Gemini CLI version: 0.38.1
  • OS: Windows 11
  • Terminal: Windows Terminal 1.23.20211.0
  • Shell: PowerShell / CMD (reproduced in both)

Description

On Windows, pressing Shift+Tab to switch between Plan and Act modes has no effect. The UI does not respond at all.

Root Cause Investigation

After thorough debugging, the issue is traced to the Windows Console subsystem. On Windows, Shift+Tab does not generate the standard escape sequence \x1b[Z — instead, it sends \x09 (plain Tab), with the Shift modifier completely lost.

This was verified using a raw Node.js keypress listener:

process.stdin.setRawMode(true);
process.stdin.resume();
process.stdin.on('data', (buf) => {
  console.log('hex:', buf.toString('hex'));
});

Results on Windows (tested across Windows Terminal, CMD, and native conhost.exe):

Key pressedExpected hexActual hex
Shift+Tab1b 5b 5a (\x1b[Z)09 (plain Tab)

Also confirmed via readline.emitKeypressEvents:

{ sequence: '\t', name: 'tab', ctrl: false, meta: false, shift: false }

The shift field is false even when Shift is physically held down. This is a fundamental limitation of the Windows Console subsystem — unlike Unix/Linux terminals, it does not encode the Shift modifier into the byte stream for the Tab key.

Impact

The Plan/Act mode toggle is completely non-functional on Windows, across all terminal emulators and shells, because the underlying Windows Console API does not transmit the necessary escape sequence.

Suggested Fix

Consider one or more of the following:

  1. Add an alternative keybinding to switch Plan/Act mode that works on Windows (e.g. Ctrl+P, Ctrl+M, or a function key).
  2. Detect the Windows platform and display a notice that Shift+Tab is unsupported, along with the alternative binding.
  3. Use the Windows Console API directly (ReadConsoleInput) to read raw KEY_EVENT records which do preserve the Shift modifier — though this would require platform-specific code.

Workaround

Currently the only workaround is to run Gemini CLI inside WSL, where Shift+Tab correctly sends \x1b[Z.

What did you expect to happen?

<img width="2100" height="374" alt="Image" src="https://github.com/user-attachments/assets/c987dca6-0085-49ac-a540-e819e01922d1" />

this should be work,but it doesn't work

Client information

<details> <summary>Client Information</summary>

Run gemini to enter the interactive CLI, then run the /about command.

> /about
# paste output here
</details>

Login information

No response

Anything else we need to know?

No response

extent analysis

TL;DR

The most likely fix is to add an alternative keybinding to switch Plan/Act mode that works on Windows.

Guidance

  • Consider adding a new keybinding such as Ctrl+P or Ctrl+M to toggle Plan/Act mode, as Shift+Tab is not supported on Windows due to a limitation in the Windows Console subsystem.
  • Detect the Windows platform and display a notice to users that Shift+Tab is unsupported, providing the alternative binding instead.
  • As a temporary workaround, users can run Gemini CLI inside WSL, where Shift+Tab correctly sends the expected escape sequence.

Example

No code example is provided as the issue does not require a specific code change, but rather a design decision on alternative keybindings.

Notes

The Windows Console subsystem's limitation in handling the Shift modifier with the Tab key is a fundamental issue, and using the Windows Console API directly may require significant platform-specific code changes.

Recommendation

Apply a workaround by adding an alternative keybinding, as upgrading to a fixed version is not mentioned as an option in the issue. This allows for a functional workaround on Windows platforms without requiring significant changes to the underlying system.

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

gemini-cli - 💡(How to fix) Fix Bug Report: Shift+Tab does not work on Windows to switch between Plan/Act modes [2 comments, 3 participants]