From 52bc9b68b3dfc1af3a0b71838e5aa11bc0dd9872 Mon Sep 17 00:00:00 2001 From: Kiet Ho Date: Sat, 17 Jan 2026 11:55:20 -0800 Subject: [PATCH 1/9] fix(desktop): trigger TUI repaint on pane focus change When switching between panes within a tab, TUI apps in alternate screen mode would show stale/blank content because they didn't know the terminal regained focus. Two mechanisms exist for TUI repaint: 1. Focus reporting (mode 1004): App sends ESC[?1004h, terminal sends CSI I on focus - handled automatically by xterm.js 2. SIGWINCH: Resize signal triggers repaint - needed for apps without focus reporting Added resize nudge (same pattern as alt-screen reattach) when isFocused changes for alt-screen terminals. This ensures TUIs like vim/htop repaint correctly regardless of whether they use focus reporting. --- .../TabsContent/Terminal/Terminal.tsx | 44 +++++++++++++++---- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx index 40f9073fff4..d8e7b492163 100644 --- a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx +++ b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx @@ -616,19 +616,24 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => { const rows = xterm.rows; if (cols <= 0 || rows <= 0) return; - // Keep PTY dimensions in sync even when FitAddon doesn't change cols/rows. - resizeRef.current({ paneId, cols, rows }); - if (!result.isNew) { + // Reattach: resize down/up to guarantee SIGWINCH for TUI repaint + resizeRef.current({ paneId, cols, rows: rows - 1 }); + setTimeout(() => { + if (xtermRef.current !== xterm) return; + resizeRef.current({ paneId, cols, rows }); + xterm.refresh(0, rows - 1); + }, 100); + const renderer = rendererRef.current?.current; if (renderer?.kind === "webgl") { - // Clear twice: once immediately, and once after fonts settle. - // This reduces restore artifacts (especially for TUIs like opencode) - // and prevents stale glyphs when fonts swap in. renderer.clearTextureAtlas?.(); } + } else { + // New session: single resize to sync PTY dimensions + resizeRef.current({ paneId, cols, rows }); + xterm.refresh(0, rows - 1); } - xterm.refresh(0, rows - 1); restoreScrollPosition(xterm, result.viewportY); } catch (error) { console.warn( @@ -965,14 +970,35 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => { } }, [isFocused]); + // biome-ignore lint/correctness/useExhaustiveDependencies: resizeRef used intentionally to read latest value without recreating callback useEffect(() => { const xterm = xtermRef.current; - if (!xterm) return; + const fitAddon = fitAddonRef.current; + if (!xterm || !fitAddon) return; if (isFocused) { xterm.focus(); + + // Trigger SIGWINCH for alt-screen TUIs so they repaint on pane focus change. + // Apps with focus reporting (mode 1004) get CSI I from xterm.js automatically. + if (isAlternateScreenRef.current) { + requestAnimationFrame(() => { + if (xtermRef.current !== xterm) return; + fitAddon.fit(); + const cols = xterm.cols; + const rows = xterm.rows; + if (cols > 0 && rows > 0) { + resizeRef.current({ paneId, cols, rows: rows - 1 }); + setTimeout(() => { + if (xtermRef.current !== xterm) return; + resizeRef.current({ paneId, cols, rows }); + xterm.refresh(0, rows - 1); + }, 100); + } + }); + } } - }, [isFocused]); + }, [isFocused, paneId]); useAppHotkey( "FIND_IN_TERMINAL", From a35282bcec85c24f0db22dad23c023532a04d339 Mon Sep 17 00:00:00 2001 From: Kiet Ho Date: Sat, 17 Jan 2026 15:30:26 -0800 Subject: [PATCH 2/9] refactor(desktop): remove redundant pane focus resize nudge The reattach cases are sufficient - pane focus change doesn't need SIGWINCH since apps with focus reporting get CSI I automatically. --- .../TabsContent/Terminal/Terminal.tsx | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx index d8e7b492163..737443d9a0d 100644 --- a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx +++ b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx @@ -970,35 +970,14 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => { } }, [isFocused]); - // biome-ignore lint/correctness/useExhaustiveDependencies: resizeRef used intentionally to read latest value without recreating callback useEffect(() => { const xterm = xtermRef.current; - const fitAddon = fitAddonRef.current; - if (!xterm || !fitAddon) return; + if (!xterm) return; if (isFocused) { xterm.focus(); - - // Trigger SIGWINCH for alt-screen TUIs so they repaint on pane focus change. - // Apps with focus reporting (mode 1004) get CSI I from xterm.js automatically. - if (isAlternateScreenRef.current) { - requestAnimationFrame(() => { - if (xtermRef.current !== xterm) return; - fitAddon.fit(); - const cols = xterm.cols; - const rows = xterm.rows; - if (cols > 0 && rows > 0) { - resizeRef.current({ paneId, cols, rows: rows - 1 }); - setTimeout(() => { - if (xtermRef.current !== xterm) return; - resizeRef.current({ paneId, cols, rows }); - xterm.refresh(0, rows - 1); - }, 100); - } - }); - } } - }, [isFocused, paneId]); + }, [isFocused]); useAppHotkey( "FIND_IN_TERMINAL", From 3c83209a64fc17c3e3b23b56ee4f0dc7aa444ad3 Mon Sep 17 00:00:00 2001 From: Kiet Ho Date: Sat, 17 Jan 2026 15:34:03 -0800 Subject: [PATCH 3/9] Revert "refactor(desktop): remove redundant pane focus resize nudge" This reverts commit a35282bcec85c24f0db22dad23c023532a04d339. --- .../TabsContent/Terminal/Terminal.tsx | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx index 737443d9a0d..d8e7b492163 100644 --- a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx +++ b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx @@ -970,14 +970,35 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => { } }, [isFocused]); + // biome-ignore lint/correctness/useExhaustiveDependencies: resizeRef used intentionally to read latest value without recreating callback useEffect(() => { const xterm = xtermRef.current; - if (!xterm) return; + const fitAddon = fitAddonRef.current; + if (!xterm || !fitAddon) return; if (isFocused) { xterm.focus(); + + // Trigger SIGWINCH for alt-screen TUIs so they repaint on pane focus change. + // Apps with focus reporting (mode 1004) get CSI I from xterm.js automatically. + if (isAlternateScreenRef.current) { + requestAnimationFrame(() => { + if (xtermRef.current !== xterm) return; + fitAddon.fit(); + const cols = xterm.cols; + const rows = xterm.rows; + if (cols > 0 && rows > 0) { + resizeRef.current({ paneId, cols, rows: rows - 1 }); + setTimeout(() => { + if (xtermRef.current !== xterm) return; + resizeRef.current({ paneId, cols, rows }); + xterm.refresh(0, rows - 1); + }, 100); + } + }); + } } - }, [isFocused]); + }, [isFocused, paneId]); useAppHotkey( "FIND_IN_TERMINAL", From 19c4da764b5cd3fc883398ed2f8e6511ff5a30eb Mon Sep 17 00:00:00 2001 From: Kiet Ho Date: Sat, 17 Jan 2026 15:36:02 -0800 Subject: [PATCH 4/9] refactor(desktop): remove redundant pane focus resize nudge Pane focus change doesn't need SIGWINCH - apps with focus reporting get CSI I automatically from xterm.js. Reattach cases still trigger resize nudge for TUI repaint. --- .../TabsContent/Terminal/Terminal.tsx | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx index d8e7b492163..737443d9a0d 100644 --- a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx +++ b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx @@ -970,35 +970,14 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => { } }, [isFocused]); - // biome-ignore lint/correctness/useExhaustiveDependencies: resizeRef used intentionally to read latest value without recreating callback useEffect(() => { const xterm = xtermRef.current; - const fitAddon = fitAddonRef.current; - if (!xterm || !fitAddon) return; + if (!xterm) return; if (isFocused) { xterm.focus(); - - // Trigger SIGWINCH for alt-screen TUIs so they repaint on pane focus change. - // Apps with focus reporting (mode 1004) get CSI I from xterm.js automatically. - if (isAlternateScreenRef.current) { - requestAnimationFrame(() => { - if (xtermRef.current !== xterm) return; - fitAddon.fit(); - const cols = xterm.cols; - const rows = xterm.rows; - if (cols > 0 && rows > 0) { - resizeRef.current({ paneId, cols, rows: rows - 1 }); - setTimeout(() => { - if (xtermRef.current !== xterm) return; - resizeRef.current({ paneId, cols, rows }); - xterm.refresh(0, rows - 1); - }, 100); - } - }); - } } - }, [isFocused, paneId]); + }, [isFocused]); useAppHotkey( "FIND_IN_TERMINAL", From ca3ec289d46d4fb1974d5b766ce579c66e0453aa Mon Sep 17 00:00:00 2001 From: Kiet Ho Date: Sat, 17 Jan 2026 15:47:19 -0800 Subject: [PATCH 5/9] Revert "refactor(desktop): remove redundant pane focus resize nudge" This reverts commit 19c4da764b5cd3fc883398ed2f8e6511ff5a30eb. --- .../TabsContent/Terminal/Terminal.tsx | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx index 737443d9a0d..d8e7b492163 100644 --- a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx +++ b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx @@ -970,14 +970,35 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => { } }, [isFocused]); + // biome-ignore lint/correctness/useExhaustiveDependencies: resizeRef used intentionally to read latest value without recreating callback useEffect(() => { const xterm = xtermRef.current; - if (!xterm) return; + const fitAddon = fitAddonRef.current; + if (!xterm || !fitAddon) return; if (isFocused) { xterm.focus(); + + // Trigger SIGWINCH for alt-screen TUIs so they repaint on pane focus change. + // Apps with focus reporting (mode 1004) get CSI I from xterm.js automatically. + if (isAlternateScreenRef.current) { + requestAnimationFrame(() => { + if (xtermRef.current !== xterm) return; + fitAddon.fit(); + const cols = xterm.cols; + const rows = xterm.rows; + if (cols > 0 && rows > 0) { + resizeRef.current({ paneId, cols, rows: rows - 1 }); + setTimeout(() => { + if (xtermRef.current !== xterm) return; + resizeRef.current({ paneId, cols, rows }); + xterm.refresh(0, rows - 1); + }, 100); + } + }); + } } - }, [isFocused]); + }, [isFocused, paneId]); useAppHotkey( "FIND_IN_TERMINAL", From 1d4e03ca9accb7333f1ed9fa237f554a9d1c5325 Mon Sep 17 00:00:00 2001 From: Kiet Ho Date: Sat, 17 Jan 2026 15:48:39 -0800 Subject: [PATCH 6/9] Reapply "refactor(desktop): remove redundant pane focus resize nudge" This reverts commit ca3ec289d46d4fb1974d5b766ce579c66e0453aa. --- .../TabsContent/Terminal/Terminal.tsx | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx index d8e7b492163..737443d9a0d 100644 --- a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx +++ b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx @@ -970,35 +970,14 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => { } }, [isFocused]); - // biome-ignore lint/correctness/useExhaustiveDependencies: resizeRef used intentionally to read latest value without recreating callback useEffect(() => { const xterm = xtermRef.current; - const fitAddon = fitAddonRef.current; - if (!xterm || !fitAddon) return; + if (!xterm) return; if (isFocused) { xterm.focus(); - - // Trigger SIGWINCH for alt-screen TUIs so they repaint on pane focus change. - // Apps with focus reporting (mode 1004) get CSI I from xterm.js automatically. - if (isAlternateScreenRef.current) { - requestAnimationFrame(() => { - if (xtermRef.current !== xterm) return; - fitAddon.fit(); - const cols = xterm.cols; - const rows = xterm.rows; - if (cols > 0 && rows > 0) { - resizeRef.current({ paneId, cols, rows: rows - 1 }); - setTimeout(() => { - if (xtermRef.current !== xterm) return; - resizeRef.current({ paneId, cols, rows }); - xterm.refresh(0, rows - 1); - }, 100); - } - }); - } } - }, [isFocused, paneId]); + }, [isFocused]); useAppHotkey( "FIND_IN_TERMINAL", From 76432c52414f8ae366346deb7c7549bc1f73809e Mon Sep 17 00:00:00 2001 From: Kiet Ho Date: Sat, 17 Jan 2026 15:49:54 -0800 Subject: [PATCH 7/9] Revert "Reapply "refactor(desktop): remove redundant pane focus resize nudge"" This reverts commit 1d4e03ca9accb7333f1ed9fa237f554a9d1c5325. --- .../TabsContent/Terminal/Terminal.tsx | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx index 737443d9a0d..d8e7b492163 100644 --- a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx +++ b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx @@ -970,14 +970,35 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => { } }, [isFocused]); + // biome-ignore lint/correctness/useExhaustiveDependencies: resizeRef used intentionally to read latest value without recreating callback useEffect(() => { const xterm = xtermRef.current; - if (!xterm) return; + const fitAddon = fitAddonRef.current; + if (!xterm || !fitAddon) return; if (isFocused) { xterm.focus(); + + // Trigger SIGWINCH for alt-screen TUIs so they repaint on pane focus change. + // Apps with focus reporting (mode 1004) get CSI I from xterm.js automatically. + if (isAlternateScreenRef.current) { + requestAnimationFrame(() => { + if (xtermRef.current !== xterm) return; + fitAddon.fit(); + const cols = xterm.cols; + const rows = xterm.rows; + if (cols > 0 && rows > 0) { + resizeRef.current({ paneId, cols, rows: rows - 1 }); + setTimeout(() => { + if (xtermRef.current !== xterm) return; + resizeRef.current({ paneId, cols, rows }); + xterm.refresh(0, rows - 1); + }, 100); + } + }); + } } - }, [isFocused]); + }, [isFocused, paneId]); useAppHotkey( "FIND_IN_TERMINAL", From d2458d4b3df44e4fa25b3fde9fbda195bb1befa4 Mon Sep 17 00:00:00 2001 From: Kiet Ho Date: Sat, 17 Jan 2026 16:01:43 -0800 Subject: [PATCH 8/9] fix(desktop): simplify terminal reattach resize handling - Remove resize nudge pattern (resize down/up) - Just call fitAddon.fit() on reattach after streaming is enabled - Fixes race condition by ensuring resize happens after attach --- .../TabsContent/Terminal/Terminal.tsx | 99 ++----------------- 1 file changed, 9 insertions(+), 90 deletions(-) diff --git a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx index d8e7b492163..4590e849ffc 100644 --- a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx +++ b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx @@ -567,24 +567,10 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => { } flushPendingEvents(); - // Fit xterm to container and trigger SIGWINCH + // Fit terminal to container - triggers resize which sends SIGWINCH requestAnimationFrame(() => { if (xtermRef.current !== xterm) return; - fitAddon.fit(); - const cols = xterm.cols; - const rows = xterm.rows; - - if (cols > 0 && rows > 0) { - // Resize down then up to guarantee SIGWINCH - resizeRef.current({ paneId, cols, rows: rows - 1 }); - setTimeout(() => { - if (xtermRef.current !== xterm) return; - resizeRef.current({ paneId, cols, rows }); - // Force xterm to repaint after SIGWINCH completes - xterm.refresh(0, rows - 1); - }, 100); - } }); }); @@ -600,61 +586,15 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => { const rehydrateSequences = result.snapshot?.rehydrateSequences ?? ""; const finalizeRestore = () => { - const redraw = () => { - requestAnimationFrame(() => { - try { - if (restoreSequenceRef.current !== restoreSequence) return; - if (xtermRef.current !== xterm) return; - - fitAddon.fit(); - if (xtermRef.current !== xterm) return; - - // Reattached sessions can sometimes render partially until the user resizes the pane. - // WebGL off fully fixes this, which strongly suggests a WebGL texture-atlas repaint bug. - // Clearing the atlas forces xterm-webgl to rebuild glyphs and repaint without a resize nudge. - const cols = xterm.cols; - const rows = xterm.rows; - if (cols <= 0 || rows <= 0) return; - - if (!result.isNew) { - // Reattach: resize down/up to guarantee SIGWINCH for TUI repaint - resizeRef.current({ paneId, cols, rows: rows - 1 }); - setTimeout(() => { - if (xtermRef.current !== xterm) return; - resizeRef.current({ paneId, cols, rows }); - xterm.refresh(0, rows - 1); - }, 100); - - const renderer = rendererRef.current?.current; - if (renderer?.kind === "webgl") { - renderer.clearTextureAtlas?.(); - } - } else { - // New session: single resize to sync PTY dimensions - resizeRef.current({ paneId, cols, rows }); - xterm.refresh(0, rows - 1); - } - restoreScrollPosition(xterm, result.viewportY); - } catch (error) { - console.warn( - "[Terminal] redraw() failed after restoration:", - error, - ); - } - }); - }; - - // Redraw once immediately, and once again after fonts settle. - redraw(); - void document.fonts?.ready.then(() => { - if (restoreSequenceRef.current !== restoreSequence) return; - if (xtermRef.current !== xterm) return; - redraw(); - }); - // Enable streaming AFTER xterm has processed the restoration writes. // This prevents live PTY output from interleaving with snapshot replay. isStreamReadyRef.current = true; + + // Fit terminal to container - triggers resize which sends SIGWINCH + requestAnimationFrame(() => { + if (xtermRef.current !== xterm) return; + fitAddon.fit(); + }); if (DEBUG_TERMINAL) { console.log( `[Terminal] isStreamReady=true (finalizeRestore): ${paneId}, pendingEvents=${pendingEventsRef.current.length}`, @@ -970,35 +910,14 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => { } }, [isFocused]); - // biome-ignore lint/correctness/useExhaustiveDependencies: resizeRef used intentionally to read latest value without recreating callback useEffect(() => { const xterm = xtermRef.current; - const fitAddon = fitAddonRef.current; - if (!xterm || !fitAddon) return; + if (!xterm) return; if (isFocused) { xterm.focus(); - - // Trigger SIGWINCH for alt-screen TUIs so they repaint on pane focus change. - // Apps with focus reporting (mode 1004) get CSI I from xterm.js automatically. - if (isAlternateScreenRef.current) { - requestAnimationFrame(() => { - if (xtermRef.current !== xterm) return; - fitAddon.fit(); - const cols = xterm.cols; - const rows = xterm.rows; - if (cols > 0 && rows > 0) { - resizeRef.current({ paneId, cols, rows: rows - 1 }); - setTimeout(() => { - if (xtermRef.current !== xterm) return; - resizeRef.current({ paneId, cols, rows }); - xterm.refresh(0, rows - 1); - }, 100); - } - }); - } } - }, [isFocused, paneId]); + }, [isFocused]); useAppHotkey( "FIND_IN_TERMINAL", From a8afc858c5810e1c2038532604e73d39ce3c1d6a Mon Sep 17 00:00:00 2001 From: Kiet Ho Date: Sat, 17 Jan 2026 16:04:38 -0800 Subject: [PATCH 9/9] Lint --- .../ContentView/TabsContent/Terminal/Terminal.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx index 4590e849ffc..02048b8fa54 100644 --- a/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx +++ b/apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx @@ -34,7 +34,6 @@ import { TerminalSearch } from "./TerminalSearch"; import type { TerminalProps, TerminalStreamEvent } from "./types"; import { getScrollOffsetFromBottom, - restoreScrollPosition, shellEscapePaths, smoothScrollToBottom, } from "./utils"; @@ -465,7 +464,6 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => { } }, [handleTerminalExit, setConnectionError]); - // biome-ignore lint/correctness/useExhaustiveDependencies: refs (resizeRef, updateCwdRef, rendererRef) used intentionally to read latest values without recreating callback const maybeApplyInitialState = useCallback(() => { if (!didFirstRenderRef.current) return; const result = pendingInitialStateRef.current; @@ -477,7 +475,7 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => { // Clear before applying to prevent double-apply on concurrent triggers. pendingInitialStateRef.current = null; - const restoreSequence = ++restoreSequenceRef.current; + const _restoreSequence = ++restoreSequenceRef.current; try { // Canonical initial content: prefer snapshot (daemon mode) over scrollback (non-daemon)