diff --git a/apps/web/src/components/terminal.tsx b/apps/web/src/components/terminal.tsx index 6c5ede1..fc267d0 100644 --- a/apps/web/src/components/terminal.tsx +++ b/apps/web/src/components/terminal.tsx @@ -266,9 +266,17 @@ export const TerminalComponent: React.FC = ({ const newSize = Math.max(MIN_FONT_SIZE, Math.min(MAX_FONT_SIZE, fontSize + delta)); setFontSize(newSize); localStorage.setItem(FONT_SIZE_KEY, newSize.toString()); - if (termRef.current) { + if (termRef.current && fitAddonRef.current) { termRef.current.options.fontSize = newSize; - fitAddonRef.current?.fit(); + requestAnimationFrame(() => { + if (termRef.current && fitAddonRef.current) { + try { + fitAddonRef.current.fit(); + } catch { + // Ignore fit errors during re-initialization + } + } + }); } }; @@ -345,26 +353,22 @@ export const TerminalComponent: React.FC = ({ )}
- {isMobile && ( - <> - - - - )} + + {onClose && (