[IDE Extension] Agents panel exit causes focus trap — UI becomes unselectable

Resolved 💬 1 comment Opened May 16, 2026 by EVEvance Closed Jun 14, 2026

Summary

After an Agents session ends or the user exits the Agents panel in the Claude Code IDE extension (VS Code), keyboard and mouse focus remains trapped inside the closed Webview. The main editor and VS Code UI elements become unresponsive to selection and clicks until focus is forcibly released.

Steps to Reproduce

  1. Open Claude Code IDE extension in VS Code
  2. Start an Agents session (open the Agents panel)
  3. Let the agent complete its task, or manually exit/close the Agents panel
  4. Attempt to click or select text in the main editor or other VS Code UI elements

Expected Behavior

After exiting the Agents panel, focus returns to VS Code normally and all UI elements remain selectable and interactive.

Actual Behavior

UI elements in the main editor and VS Code interface become unresponsive. Clicks and text selection do not register until focus is manually released (e.g., pressing Escape, clicking the Activity Bar, or running Developer: Reload Webviews).

Environment

  • OS: Windows 11 Home 10.0.26200
  • Claude Code version: 2.1.143
  • IDE: VS Code (Windows)

Workarounds (temporary)

  • Press Escape to release focus trap
  • Click VS Code Activity Bar (left icon rail)
  • Ctrl+Shift+PDeveloper: Reload Webviews
  • Ctrl+Shift+PDeveloper: Reload Window (last resort)

Root Cause Hypothesis

This is consistent with a Webview lifecycle bug where panel.dispose() or the equivalent close handler does not call panel.webview.postMessage / focus transfer before teardown, leaving the Webview's focus event handler registered but the panel invisible. The OS-level window focus stays with the Webview host, not the editor.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗