From 583bb46c5115d3928d9286e0b89f089efe659a58 Mon Sep 17 00:00:00 2001 From: CoderLuii Date: Fri, 10 Apr 2026 08:29:34 +0000 Subject: [PATCH] fix: preserve Shell tab scroll position across periodic refresh --- src/components/shell/view/Shell.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/shell/view/Shell.tsx b/src/components/shell/view/Shell.tsx index 575b0ac34b..e264472de4 100644 --- a/src/components/shell/view/Shell.tsx +++ b/src/components/shell/view/Shell.tsx @@ -165,7 +165,11 @@ export default function Shell({ } const focusTerminal = () => { - terminalRef.current?.focus(); + const term = terminalRef.current; + if (!term) return; + const savedViewport = term.buffer.active.viewportY; + term.focus(); + term.scrollToLine(savedViewport); }; const animationFrameId = window.requestAnimationFrame(focusTerminal);