fix: force xterm.js canvas redraw on resize via internal renderer

This commit is contained in:
Fusion
2026-05-24 18:47:27 +02:00
parent d931f3071d
commit 85f04447ea
+7 -1
View File
@@ -219,9 +219,15 @@ export const TerminalComponent: React.FC<TerminalProps> = ({
if (!fitAddonRef.current || !termRef.current) return;
const oldCols = termRef.current.cols;
const oldRows = termRef.current.rows;
// Force layout recalculation before fit
if (container) {
void container.offsetWidth;
void container.offsetHeight;
}
fitAddonRef.current.fit();
const { cols, rows } = termRef.current;
// Force refresh if dimensions changed
if (cols !== oldCols || rows !== oldRows) {
termRef.current.refresh(0, rows - 1);
}