[BUG] Agent View (via double-click left arrow) Esc exit causes CLI hang and terminal misalignment

Status Fixed / completed
Reported on v2.1.161
Maintainer reply ✓ Yes — bcherny
Activity 4 comments · opened Jun 3, 2026 · closed Aug 19, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When running Claude Code in Windows 11 CMD, after entering the CLI via the claude command, double-clicking the left arrow key to open the Agent View and then pressing Esc causes Claude to hang for several seconds on the normal transcript before exiting entirely. Additionally, CMD exhibits terminal rendering/display misalignment artifacts after this sequence. However, launching directly into Agent View via claude agents and then exiting does not reproduce the display misalignment issue.

<img width="1722" height="153" alt="Image" src="https://github.com/user-attachments/assets/e569816d-16b6-4705-88e6-01084102a38a" />

What Should Happen?

Pressing Esc in Agent View launched by claude should dismiss the view and return to the normal chat interface without exiting Claude Code or causing any terminal rendering corruption.

<img width="1713" height="96" alt="Image" src="https://github.com/user-attachments/assets/6f61fcc9-14cc-4091-b303-b2bfafc7e2ca" />

Error Messages/Logs

Steps to Reproduce

  1. Open CMD on Windows 11
  2. Run claude to enter interactive CLI
  3. Double-click left arrow key to navigate into Agent View
  4. Press Esc to exit Agent View
  5. Observe: Claude hangs on the chat interface for several seconds, then exits completely
  6. Observe: CMD displays terminal misalignment/rendering artifacts after exit

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.161 (Claude Code)

Platform

Other

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

  • The display misalignment only occurs when entering Agent View from the standard claude command flow, not from claude agents directly
  • Suspected root cause may be incomplete terminal state restoration (e.g., cursor position, alternate screen buffer) when transitioning between views via the claude entry point

View original on GitHub ↗

3 Comments

github-actions[bot] · 4 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/59720
  2. https://github.com/anthropics/claude-code/issues/60212
  3. https://github.com/anthropics/claude-code/issues/59814

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Jeffreycitron · 2 months ago

Also reproducible on macOS with the current version (2.1.214), so this is not Windows/CMD-specific. On macOS there is no hang or rendering corruption — pressing Esc in the Agent View simply quits Claude Code entirely and drops back to the shell prompt.

Steps to reproduce

  1. Start claude in interactive mode.
  2. With an empty prompt, press the left arrow key once — the agent view (parallel-sessions panel) opens.
  3. Press Esc.

Expected: Return to the session/main prompt. Per the agent view docs, Escape should only exit the agent view and return to the session; the only documented quit shortcut is Ctrl+D pressed twice within ~800ms.

Actual: Claude Code exits completely to the shell.

Environment

  • Claude Code version: 2.1.214
  • OS: macOS 26.2 (build 25C56, Darwin 25.2.0)
  • Terminal: TERM=xterm-256color
bcherny collaborator · 1 month ago

Fixed in 2.1.163 — changelog: "Fixed terminal misalignment and a multi-second hang when exiting the agent view by pressing Esc" (https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md). Closing — reply to reopen if it still happens on the latest version.

🤖 Generated with Claude Code

Showing cached comments. Read the full discussion on GitHub ↗