Skip to content

[BUG] Input focus lost to PowerShell shell - interactive menu unresponsive (Windows) #21266

@ThatDragonOverThere

Description

@ThatDragonOverThere

Bug Description

After Claude Code completes a task (especially ones involving gh commands), keyboard input is captured by the underlying PowerShell shell instead of Claude Code's interactive interface.

Environment

  • Platform: Windows 11
  • Terminal: PowerShell (not Windows Terminal)
  • Claude Code: Latest

Steps to Reproduce

  1. Run Claude Code in PowerShell
  2. Execute a task that runs gh commands (e.g., gh issue comment)
  3. Task completes successfully, Claude Code shows result
  4. Claude Code displays its prompt (❯) as if ready for input
  5. Try to type a new prompt or interact with menu

Expected Behavior

  • Keyboard input should go to Claude Code
  • Interactive menus (Yes/No confirmations) should respond to keystrokes
  • Escape should work for cancellation

Actual Behavior

  • Input goes to PowerShell prompt instead of Claude Code
  • PowerShell prompt visible: (env) PS C:\path>
  • Typing characters appear in PowerShell, not Claude Code
  • Menu options (1, 2, arrow keys, Enter, Escape) don't work
  • Interface appears frozen but isn't crashed
  • Must force-kill terminal to recover

Variations Observed

Variation 1: Menu Confirmation Freeze

Do you want to proceed?
❯ 1. Yes
  2. No
Esc to cancel · Tab to add additional instructions

Pressing 1/2/Enter/Escape - nothing happens. Input goes to shell.

Variation 2: Post-Task Input Capture
Task completes with "Done: [link]", shows ❯ prompt, but all keystrokes go to PowerShell.

Frequency

Happened twice in same session:

  1. After long-running task completion
  2. After quick gh issue comment task

Possibly Related

This may be a focus/stdin management issue when returning from subprocess execution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:tuibugSomething isn't workinghas reproHas detailed reproduction stepsplatform:windowsIssue specifically occurs on WindowsstaleIssue is inactive

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions