google-gemini/gemini-cli

Gemini CLI doesn't maintain keyboard focus when VS Code extension closes a diff

Open

#22193 opened on Mar 12, 2026

View on GitHub
 (6 comments) (0 reactions) (1 assignee)TypeScript (103,992 stars) (13,657 forks)batch import
area/extensionseffort/mediumhelp wantedkind/bugpriority/p1status/bot-triagedstatus/need-retestingstatus/possible-duplicate

Description

What happened?

When Gemini is making changes in code that I care about, I like to at least start by manually reviewing changes. The VS Code plugin makes this very convenient to do, by showing a nice diff preview in the editor pane while I have Gemini CLI running in the Terminal pane.

Every time I click "Yes" to approve a file edit, the diff preview closes and Gemini CLI loses keyboard focus. This means that for the very next diff, I can't just press . I need to click again on the terminal pane, then click enter. For. Every. Single. Edit.

https://github.com/user-attachments/assets/6fc5e035-157d-44e8-a3dc-ee8be0de0f8e

What did you expect to happen?

I expected the Gemini CLI to maintain focus when stepping through file changes. It's what you'd expect, and it's also how competitive coding agent IDE integrations work.

Client information

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

> /about
About Gemini CLI                                                                                                                                            │
│                                                                                                                                                             │
│ CLI Version                                           0.33.0                                                                                                │
│ Git Commit                                            6ee19e1f6                                                                                             │
│ Model                                                 Auto (Gemini 3)                                                                                       │
│ Sandbox                                               no sandbox                                                                                            │
│ OS                                                    darwin                                                                                                │
│ Auth Method                                           Logged in with Google (gjuggler@gmail.com)                                                            │
│ Tier                                                  Gemini Code Assist in Google One AI Ultra

Login information

No response

Anything else we need to know?

This has been my #1 frustration since I started actively using Gemini CLI. I was surprised that there wasn't an issue filed about this problem already. Am I the only one who isn't always auto-approving edits? Am I holding it wrong by running Gemini within the VS Code terminal pane?

Contributor guide