Skip to content

fix(web): terminal doesn't get keyboard focus when opening a session/agent view#2485

Open
mukesher4 wants to merge 1 commit into
AgentWrapper:mainfrom
mukesher4:ao/agent-orchestrator-6/terminal-focus-fix
Open

fix(web): terminal doesn't get keyboard focus when opening a session/agent view#2485
mukesher4 wants to merge 1 commit into
AgentWrapper:mainfrom
mukesher4:ao/agent-orchestrator-6/terminal-focus-fix

Conversation

@mukesher4

@mukesher4 mukesher4 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • XtermTerminal.tsx's AttachableTerminal handle now exposes focus: () => term.focus(), and the type in useTerminalSession.ts declares it.
  • TerminalPane.tsx's AttachedTerminal mount effect calls terminal.focus() once a session is actually attached (handleId present), so the empty-state pane never steals focus.

Fixes #2434.

Screen Recording

Screen Recording

Test plan

  • npm run typecheck (frontend)
  • npx vitest run (frontend, 466 tests pass)
  • Manual: open a session from the Kanban board and confirm typing works without clicking the terminal first

🤖 Generated with Claude Code

xterm's term.focus() was never called on attach, so users had to
click inside the pane before typing worked. Expose focus() on the
AttachableTerminal handle and call it from TerminalPane's mount
effect once a session is actually attached.

Fixes AgentWrapper#2434

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(web): terminal doesn't get keyboard focus when opening a session/agent view

1 participant