Escape key cancels running background agents — should only clear input line
Resolved 💬 4 comments Opened Feb 27, 2026 by grigb Closed Mar 2, 2026
Bug Description
Pressing Escape while a background agent is running kills the agent. The expected behavior is that Escape should only clear the current input line, not cancel running background work.
Steps to Reproduce
- Launch a background agent with
run_in_background: true - While waiting for it to complete, start typing in the input field
- Press Escape to clear what you typed
- The background agent gets killed
Expected Behavior
Escape should clear the input line only. Background agents should continue running uninterrupted.
Actual Behavior
Escape kills the running background agent, requiring the user to re-launch it — wasting time and API credits.
Impact
- Accidental agent kills during long-running tasks (e.g., tar compression, large codebase scans)
- Wasted API credits from having to re-run killed agents
- User frustration from lost work
Environment
- Claude Code version: 2.1.44
- OS: macOS (Darwin 23.6.0)
- Terminal: iTerm2
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗