[Bug] Esc in the subagent view interrupts the running agent as well as dismissing the view

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 0 comments · opened Jul 25, 2026

Bug Description
It is impossible to unbind "esc" within a subagent view. Pressing esc when selecting a subagent always interrupts it, even when the action to cancel is unbound.

Pressing Esc inside the subagent detail view both closes the view and interrupts the running agent.
Dismissing a read-only detail view should not cancel the work it was displaying.
Every other dismiss action in Claude Code (help:dismiss, diff:dismiss, attachments:exit, transcript:exit) is non-destructive, and task:background (ctrl+b) already exists as the intended "stop watching, keep working" path.
The interrupt is also unreachable from keybinding config, so it cannot be worked around.

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.1.220
  • Feedback ID: bb5ea67a-24c7-42ba-b829-320a5484d527

Errors

[]

Steps to reproduce

  1. Start a long-running foreground subagent.
  2. Open the subagent view.
  3. Press Esc once.

Expected: the view closes and the agent keeps running, recoverable via the subagent view or a task notification.

Actual: the view closes and the agent is interrupted. Its work is lost.

Why this is easy to hit

You are in the subagent view precisely because you are watching a long run.
Esc is the reflex for "back out of this panel," and it is the same key that kills the run.
There is no confirmation and no undo.

Interaction with keybinding config

Unbinding chat:cancel protects the chat view but has no effect on the subagent view:

{
  "bindings": [
    { "context": "Chat", "bindings": { "escape": null } }
  ]
}
┌────────────────────────────────────────┬──────────────────────────────────┬──────────┐
│                 Focus                  │            Single Esc            │ Correct? │
├────────────────────────────────────────┼──────────────────────────────────┼──────────┤
│ Chat view, main loop working           │ inert                            │ yes      │
├────────────────────────────────────────┼──────────────────────────────────┼──────────┤
│ Chat view, foreground subagent running │ inert                            │ yes      │
├────────────────────────────────────────┼──────────────────────────────────┼──────────┤
│ Subagent view, subagent running        │ closes view AND interrupts agent │ no       │
└────────────────────────────────────────┴──────────────────────────────────┴──────────┘

Adding a Task context override does not help:

{ "context": "Task", "bindings": { "escape": null } }

View original on GitHub ↗