Skip to content

Bug: Pressing Escape in '!' shell mode cancels ongoing agent request instead of exiting shell mode #20615

@rasoolsomji

Description

@rasoolsomji

What happened?

When the AI agent is currently thinking or executing tools in the background, entering shell mode by typing an exclamation mark (!) works as expected. The UI indicates that pressing Escape will leave shell mode.

However, pressing Escape does not actually exit shell mode. Instead, it seems to propagate the interrupt signal up, causing the ongoing background agent request to be cancelled ("Request cancelled"), while the input field remains stuck in shell mode.

What did you expect to happen?

Pressing Escape while in the ! shell input mode should clear the input field and return the user to the standard chat input mode, without cancelling the agent's ongoing background execution.

Client information

Client Information
CLI Version: 0.30.0
OS: darwin

Login information

N/A

Anything else we need to know?

Reproduction Steps:

  1. Send a complex request to the Gemini CLI that will take some time to process.
  2. While the agent is working, type ! to enter shell mode.
  3. Observe the UI prompt indicating to press Escape to exit.
  4. Press Escape.
  5. Notice that the shell mode is not exited, but the agent's background task is terminated with a "Request cancelled" message.

Metadata

Metadata

Assignees

Labels

area/coreIssues related to User Interface, OS Support, Core Functionalityhelp wantedWe will accept PRs from all issues marked as "help wanted". Thanks for your support!priority/p2Important but can be addressed in a future release.status/possible-duplicatetype/bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions