Bug Description
When an AI agent uses the run_shell_command tool in Gemini CLI, it is granted a hardcoded 5-minute timeout. If the AI executes a command that requires interactive input (e.g., git pull waiting for credentials) or is extremely slow (e.g., grep -r on a large NTFS drive via WSL), the CLI opens an interactive PTY showing:
! Shell awaiting input (Tab to focus)
However, the AI agent is completely blocked and unaware that it should provide input or cancel the command. It just hangs silently until the 5-minute timeout is reached, severely disrupting automated workflows.
Expected Behavior
- Provide an option in
settings.json (e.g., shell.disablePtyForAgents: true) to force commands to run non-interactively (e.g., automatically appending < /dev/null).
- Provide a shorter, configurable timeout for
run_shell_command so agents can fail fast and try a different approach instead of waiting 5 minutes.
Current Workaround
Users have to manually instruct the system prompt (Master Instruction) to forbid agents from using grep -rn via the shell and instead force them to use native MCP tools (grep_search), or explicitly tell the agent to ALWAYS append < /dev/null to commands.
Submitted automatically via Gemini CLI.
Bug Description
When an AI agent uses the
run_shell_commandtool in Gemini CLI, it is granted a hardcoded 5-minute timeout. If the AI executes a command that requires interactive input (e.g.,git pullwaiting for credentials) or is extremely slow (e.g.,grep -ron a large NTFS drive via WSL), the CLI opens an interactive PTY showing:! Shell awaiting input (Tab to focus)However, the AI agent is completely blocked and unaware that it should provide input or cancel the command. It just hangs silently until the 5-minute timeout is reached, severely disrupting automated workflows.
Expected Behavior
settings.json(e.g.,shell.disablePtyForAgents: true) to force commands to run non-interactively (e.g., automatically appending< /dev/null).run_shell_commandso agents can fail fast and try a different approach instead of waiting 5 minutes.Current Workaround
Users have to manually instruct the system prompt (Master Instruction) to forbid agents from using
grep -rnvia the shell and instead force them to use native MCP tools (grep_search), or explicitly tell the agent to ALWAYS append< /dev/nullto commands.Submitted automatically via Gemini CLI.