Skip to content

Bug: Background git fetch for private extensions hijacks stdin, causing terminal freeze #23480

Description

@shaggyze

Description

When a Gemini CLI extension is installed via git from a private repository, the CLI attempts to perform background git operations (like git fetch) to check for updates on startup. Because the repository is private and requires authentication, the hidden git process hangs waiting for a username/password or SSH passphrase.

This hidden git process hijacks the terminal's standard input (stdin).

Key Behavior with Flags:
If launching the CLI from the terminal with interactive or prompt flags (e.g., gemini -p "do something" or gemini -i), the CLI will successfully run until the end of its first turn (the AI will generate and display its response). However, once the AI finishes, control is never returned to the user; the terminal remains "frozen" to keyboard input.

UI Observations During Freeze:

  • The terminal behaves as if it's in "Copy Mode".
  • Search (Ctrl + F), mouse highlighting/selection, and right-clicking all work normally.
  • Standard typing is completely swallowed by the invisible git prompt. The user cannot type anything until the .git folder is removed or the git process is manually killed.

Steps to Reproduce

  1. Install an extension via git from a private repository where git will prompt for credentials.
  2. Launch gemini-cli (with or without flags) from the terminal.
  3. Observe that while the AI may complete its first turn, keyboard input is unresponsive for the user.

Expected Behavior

Background git operations should run non-interactively (e.g., using GIT_TERMINAL_PROMPT=0 git fetch) or have their stdin detached/piped to /dev/null so they fail gracefully on auth errors instead of stealing focus from the user.

Environment

  • OS: Linux
  • Gemini CLI

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/extensionsIssues related to Gemini CLI extensions capabilityeffort/medium2-3 days: UI state, async flow, cross-component refactorskind/bugpriority/p2Important but can be addressed in a future release.status/bot-triagedtype/bug🔒 maintainer only⛔ Do not contribute. Internal roadmap item.

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions