From 9afd559394ae1cec6a8f0d93ae8e7b3131a39ad4 Mon Sep 17 00:00:00 2001 From: Fusion Date: Sun, 24 May 2026 13:20:49 +0200 Subject: [PATCH] fix: reduce minimum font size and prevent reconnection on font size change - Reduce MIN_FONT_SIZE from 16 to 10 for better range - Remove calculateFontSize from useEffect dependencies to prevent terminal re-initialization when font size changes - Font size changes now update xterm options directly without disposing/recreating the terminal (no WebSocket reconnection) --- apps/web/src/components/terminal.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/terminal.tsx b/apps/web/src/components/terminal.tsx index fc267d0..8c3b236 100644 --- a/apps/web/src/components/terminal.tsx +++ b/apps/web/src/components/terminal.tsx @@ -21,7 +21,7 @@ interface TerminalProps { } const FONT_SIZE_KEY = "terminal-font-size"; -const MIN_FONT_SIZE = 16; +const MIN_FONT_SIZE = 10; const MAX_FONT_SIZE = 24; const RECONNECT_ATTEMPTS = 3; const RECONNECT_DELAY_BASE = 1000; @@ -242,7 +242,8 @@ export const TerminalComponent: React.FC = ({ ws.close(); term.dispose(); }; - }, [instanceId, connectWebSocket, calculateFontSize]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [instanceId, connectWebSocket]); // Update parent about status changes useEffect(() => {