Skip to content

Bug: Terminal does not accept keyboard input after agent process exits #1519

@jidohyun

Description

@jidohyun

Bug Description

After an agent (e.g. Codex) finishes its session and exits back to the shell prompt, the terminal becomes unresponsive to keyboard input. The shell prompt is visible and the cursor is blinking, but no keystrokes are delivered to the terminal. This occurs in the multi-agent task view.

Steps to Reproduce

  1. Create a multi-agent task with Codex (or any agent)
  2. Let the agent run and complete its work, or exit the agent session (e.g. via /exit or the agent hitting a rate limit)
  3. The agent process exits and the shell prompt appears in the terminal
  4. Try to type any command in the terminal

Actual Behavior

The terminal does not accept any keyboard input. The shell prompt is displayed correctly but keystrokes are completely ignored. The only workaround is to restart the task or the app.

Expected Behavior

After the agent process exits, the terminal should return to a normal interactive shell where the user can type commands freely.

Possible Cause

The PTY session may not be re-enabling stdin after the agent process exits, or the xterm.js terminal instance may still have disableStdin set. It could also be a focus management issue where the terminal fails to reclaim keyboard focus after the agent exit event.

Related issues (similar symptoms but different triggers):

  • GEN-432 — Terminal unresponsive on initial startup
  • GEN-571 — Text input fields randomly stop accepting input

Environment

  • emdash version: latest (built from main @ d8cb465)
  • OS: macOS
  • Agent: Codex (observed in multi-agent task view)

Screenshot

The screenshot below shows the terminal after the Codex agent exited. The shell prompt is visible at the bottom but keyboard input is not accepted:

Shell prompt is displayed (~/De/B/w/ai-image-local-codex-6m0 on emdash/ai-image-local-codex-6m0) but no keystrokes register.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions