diff --git a/apps/web/src/components/terminal.tsx b/apps/web/src/components/terminal.tsx index e49955d..308d02a 100644 --- a/apps/web/src/components/terminal.tsx +++ b/apps/web/src/components/terminal.tsx @@ -197,7 +197,15 @@ export const TerminalComponent: React.FC = ({ term.loadAddon(fitAddon); term.loadAddon(new WebLinksAddon()); - term.open(terminalRef.current); + // Ensure container has explicit dimensions before xterm initializes + const container = terminalRef.current; + const parentRect = container.parentElement?.getBoundingClientRect(); + if (parentRect) { + container.style.width = `${parentRect.width}px`; + container.style.height = `${parentRect.height}px`; + } + + term.open(container); // Connect WebSocket const ws = connectWebSocket();