Skip to content

fix: focus terminal on sidebar session click - #66

Merged
aterrylu merged 1 commit into
mainfrom
terry/focus-terminal
Mar 25, 2026
Merged

fix: focus terminal on sidebar session click#66
aterrylu merged 1 commit into
mainfrom
terry/focus-terminal

Conversation

@aterrylu

Copy link
Copy Markdown
Owner

Sidebar click now blurs the row so terminal captures focus immediately. No more clicking the terminal after switching sessions.

Sidebar session rows have tabIndex={0}, so clicking them captures
browser focus on the row's <div>. The terminal's useEffect focus
call fires async but gets swallowed by the still-focused sidebar.

Fix: blur the active element after switchPane() in all click handlers
(ungrouped sessions, group members, group headers). This releases
focus so useTerminal's isActive effect can grab it for xterm.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aterrylu
aterrylu merged commit 24cc41d into main Mar 25, 2026
1 check passed
@aterrylu
aterrylu deleted the terry/focus-terminal branch March 25, 2026 08:11
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.

1 participant