diff --git a/site/src/pages/TerminalPage/TerminalPage.tsx b/site/src/pages/TerminalPage/TerminalPage.tsx index 9740e23923..3e344a266a 100644 --- a/site/src/pages/TerminalPage/TerminalPage.tsx +++ b/site/src/pages/TerminalPage/TerminalPage.tsx @@ -343,7 +343,15 @@ const TerminalPage: FC = () => { agent={workspaceAgent} status={connectionStatus} onAlertChange={() => { + // First fit might not calculate correctly, apply a small delay and fit again fitAddonRef.current?.fit(); + + // Apply a second fit after a small delay to ensure terminal size is correct + // This fixes the issue where text at the bottom of the terminal is hidden + // when startup scripts fail + setTimeout(() => { + fitAddonRef.current?.fit(); + }, 100); }} />
>; -export default TerminalPage; +export default TerminalPage; \ No newline at end of file