fix(desktop): focus xterm when v2 pane becomes active via FOCUS_PANE_* hotkey
Closed
MA
4mo ago+6+6+0123456789-0-0-0123456789
Summary
FOCUS_PANE_*hotkeys (Cmd+Alt+Arrow, added in #3460) visually moved the active pane indicator in v2 workspaces but never transferred actual keyboard focus to the new terminal- Root cause:
setActivePaneupdates the store (ctx.isActive) but there was no effect to callxterm.focus()— unlike v1, which has this inuseTerminalHotkeys - Fix: add a
useEffectinTerminalPanethat callsterminal.focus()whenctx.isActivebecomes true, mirroring the v1 pattern
Context
PREV_WORKSPACE/NEXT_WORKSPACEare also reported as broken — this is intentional: theirCmd+Alt+Up/Downbindings were freed forFOCUS_PANE_UP/DOWNin c925f4d. Users can rebind them in Settings → Keyboard.
Test plan
- Open a v2 workspace with 2+ split terminal panes
- Focus one terminal (click into it, type something)
- Press
Cmd+Alt+→— confirm keyboard focus moves to the right pane (cursor blinks there, typing goes there) - Press
Cmd+Alt+←— confirm focus returns
Summary by cubic
Fixes v2 pane focus hotkeys so keyboard focus moves to the selected terminal when using Cmd+Alt+Arrow, not just the visual highlight.
- Bug Fixes
- Root cause:
setActivePaneupdatedctx.isActivebut never calledxterm.focus(). - Fix: added a
useEffectinTerminalPaneto callterminal.focus()whenctx.isActivebecomes true, matching v1 behavior.
- Root cause:
Summary by CodeRabbit
- New Features
- Terminal panes now automatically receive keyboard focus when activated via hotkeys, improving workflow efficiency.