From 1da365fc15be57b4b8fe36936740e460ab1b4f68 Mon Sep 17 00:00:00 2001 From: "sean.yoon" Date: Wed, 15 Apr 2026 10:42:16 +0900 Subject: [PATCH] fix(desktop): focus xterm when v2 pane becomes active via FOCUS_PANE_* hotkey setActivePane updates the store (ctx.isActive) but never called xterm.focus(), so Cmd+Alt+Arrow moved the visual focus indicator without transferring actual keyboard focus. Add a useEffect mirroring v1's useTerminalHotkeys pattern. --- .../components/TerminalPane/TerminalPane.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/TerminalPane.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/TerminalPane.tsx index 4eb5af43698..60ee50fc596 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/TerminalPane.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/TerminalPane.tsx @@ -191,6 +191,12 @@ export function TerminalPane({ ctx, workspaceId }: TerminalPaneProps) { [terminalId, connectionState], ); + // Physically move keyboard focus when this pane becomes active via hotkey (e.g. FOCUS_PANE_*) + useEffect(() => { + if (!ctx.isActive || !terminal) return; + terminal.focus(); + }, [ctx.isActive, terminal]); + // biome-ignore lint/correctness/useExhaustiveDependencies: connectionState is intentionally included to trigger re-derive const searchAddon = useMemo( () => terminalRuntimeRegistry.getSearchAddon(terminalId),