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)
This commit is contained in:
Fusion
2026-05-24 13:20:49 +02:00
parent 25da0c149a
commit 9afd559394
+3 -2
View File
@@ -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<TerminalProps> = ({
ws.close();
term.dispose();
};
}, [instanceId, connectWebSocket, calculateFontSize]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [instanceId, connectWebSocket]);
// Update parent about status changes
useEffect(() => {