Skip to content

Escape key does not cancel/dismiss inline assist (PromptEditor) #45299

@pchalasani

Description

@pchalasani

Summary

Pressing Escape does not cancel or dismiss the inline assist prompt (PromptEditor). Users must click the X button with the mouse to close it, which breaks keyboard-driven workflow.

Steps to Reproduce

  1. Open any file in Zed
  2. Select some text or place cursor on a line
  3. Press Ctrl+Enter to open inline assist
  4. Press Escape to try to cancel/dismiss

Expected Behavior

Pressing Escape should dismiss the inline assist prompt and return focus to the editor, similar to how Escape dismisses other UI elements (command palette, search bar, etc.).

Actual Behavior

Nothing happens. The inline assist prompt remains open. The only way to close it is to click the X button with the mouse.

Attempted Workarounds

Added custom keybindings to user keymap, none of which worked:

{
  "context": "PromptEditor",
  "bindings": {
    "escape": "menu::Cancel"
  }
}
{
  "context": "PromptEditor",
  "bindings": {
    "escape": "editor::Cancel"
  }
}
{
  "context": "PromptEditor > Editor",
  "bindings": {
    "escape": "menu::Cancel"
  }
}

Analysis

Looking at the default keymap, the PromptEditor context has no escape binding defined. There also doesn't appear to be a dedicated action like inline_assistant::Cancel or assistant::CancelInlineAssist in the All Actions documentation.

The agent::Reject action exists but only applies after the AI has generated a response, not for dismissing the prompt itself.

Environment

  • OS: macOS
  • Zed Version: Latest stable
  • Base Keymap: JetBrains

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ai/agent threadFeedback for the agent threadarea:controls/keybindsKeyboard shortcuts, mapping, binding, keymaps, etcfrequency:alwaysBug that happens for everyone on every platform no matter how they use Zedpriority:P3Papercuts, minor issues with a clear workaround, cosmetic bugsstate:claimed by communitysomeone from the community has a PR in progressstate:needs reproNeeds reproduction steps / someone to reproduce

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions