[BUG] Pressing Esc to exit /btw mode rejects the pending tool-use prompt instead of just exiting the mode
Summary
When in /btw mode with a tool-use / permission prompt pending from the assistant, pressing Esc — which is the way to exit /btw mode — gets routed to the pending prompt and declines/rejects the tool use, instead of simply exiting /btw mode. The user only intended to leave /btw mode, but the assistant receives a "user rejected the tool use" signal and changes course.
Steps to reproduce
- Enter
/btwmode. - While in
/btwmode, have the assistant issue a tool call that triggers a permission/confirmation prompt (e.g. anAskUserQuestion, or any tool requiring approval). - Press Esc to exit
/btwmode (the documented/only way out of the mode).
Expected
Esc exits /btw mode and leaves the pending tool-use prompt untouched (still pending, or otherwise unaffected). Exiting a mode and rejecting a tool call should not be conflated.
Actual
Esc is consumed by the pending tool-use prompt and declines it. The assistant is told the user rejected the tool use (even though the user did not intend to decline anything), and there is no separate way to exit /btw mode without hitting the prompt.
Impact
- The assistant misinterprets the Esc as a deliberate rejection and abandons / redirects whatever it was doing.
- The user is effectively unable to exit
/btwmode while a tool prompt is pending without side effects.
Environment
- Claude Code: 2.1.150
- OS: macOS (Darwin 25.5.0)
Notes
Key conflict: /btw mode's only exit is Esc, but Esc is also the reject/cancel key for a pending tool-use permission prompt. When both are active, the prompt swallows the Esc. A possible fix would be to have Esc exit the mode first (without rejecting the pending tool call), or to provide a distinct keybinding for exiting /btw mode.
Showing cached comments. Read the full discussion on GitHub ↗
6 Comments
Commenting to keep this bug report on Anthropic's radar.
Upvote if you are reading this and have the problem described
I noticed this behavior occurred for me after the introduction of the fullscreen tui. Try doing a "/tui default" and see if that resolves for you (it did for me).
we need this fix 🤓
I'm switching from claude code to goose. (Note Anthropic is part of the AAIF, so they shouldn't be too mad about it.) But probably going to be paying less attention to claude code bugs now. If there's a bug in goose, I can fix it myself.
I have noticed this behavior on Mac, Windows, and Raspberry PI both natively and via SSH sessions. Please pick something else to switch from or close the btw session. It's a great feature! But as is, unusable.
Any news on this bug? It's really annoying and open for quite a while
I'm on Mac, ghostty, claude code v2.1.212