gemini-cli - 💡(How to fix) Fix Non-atomic policy enforcement and synchronous I/O deadlock during command chaining

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…

Root Cause

This left the filesystem in an inconsistent state. Furthermore, the CLI entered a "hung" state because it was awaiting a synchronous confirmation prompt for the mutation that was either obscured or not properly surfaced to the user, requiring a manual SIGINT (Escape) to recover.

Code Example

> /about
# paste output here

╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                             │
About Gemini CLI│                                                                                                                                                                             │
CLI Version                                                 0.42.0Git Commit                                                  68e2196d5                                                                                                       │
Model                                                       gemini-3-flash-preview                                                                                          │
Sandbox                                                     no sandbox                                                                                                      │
OS                                                          linux                                                                                                           │
Auth Method                                                 Signed in with GoogleTier                                                        Gemini Code Assist for individuals                                                                              │
IDE Client                                                  VS Code│                                                                                                                                                                             │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
RAW_BUFFERClick to expand / collapse

What happened?

When attempting to execute a chained shell command (e.g., mv file1 file2 && mv file3 file4), the CLI's security middleware partially executed the first command but then blocked the remainder of the chain due to a policy violation (prohibiting &&).

This left the filesystem in an inconsistent state. Furthermore, the CLI entered a "hung" state because it was awaiting a synchronous confirmation prompt for the mutation that was either obscured or not properly surfaced to the user, requiring a manual SIGINT (Escape) to recover.

What did you expect to happen?

  1. The security policy should be enforced atomically and pre-emptively. Chained commands containing prohibited operators should be rejected before any part of the command is executed.

  2. The CLI should not deadlock or "hang" on obscured synchronous confirmation prompts. If a mutation is rejected or requires confirmation, the state should be clearly communicated without blocking the process indefinitely.

Client information

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

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

> /about
# paste output here

╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                             │
│ About Gemini CLI                                                                                                                                                            │
│                                                                                                                                                                             │
│ CLI Version                                                 0.42.0                                                                                                          │
│ Git Commit                                                  68e2196d5                                                                                                       │
│ Model                                                       gemini-3-flash-preview                                                                                          │
│ Sandbox                                                     no sandbox                                                                                                      │
│ OS                                                          linux                                                                                                           │
│ Auth Method                                                 Signed in with Google                                                                    │
│ Tier                                                        Gemini Code Assist for individuals                                                                              │
│ IDE Client                                                  VS Code                                                                                                         │
│                                                                                                                                                                             │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
</details>

Login information

No response

Anything else we need to know?

No response

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 Non-atomic policy enforcement and synchronous I/O deadlock during command chaining