fix(agents): terminal fills the panel on maximize
- Mount xterm as an absolute inset-0 fill so it always has an explicit box and fit() measures the real size when the dock expands (was collapsing via the flex/percentage height chain). - Acquire the pty slave as the child's controlling terminal (setsid + TIOCSCTTY) so the kernel delivers SIGWINCH on a browser resize. Previously the initial size was read once but live resizes were dropped, so the pane stayed at its startup size — content never grew with the window.
This commit is contained in:
@@ -219,13 +219,18 @@ export function AgentTerminal({
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
{/* Sized region + an absolutely-filled xterm mount. The absolute inset-0
|
||||
child always has an explicit box equal to its parent, so `fit()` never
|
||||
measures a stale/percentage-collapsed height — the terminal tracks the
|
||||
panel as it expands. */}
|
||||
<div
|
||||
ref={containerRef}
|
||||
className={cn(
|
||||
maximized || fill ? "flex-1 min-h-0 p-2" : "h-[560px] p-2",
|
||||
compact && "max-sm:p-0",
|
||||
)}
|
||||
/>
|
||||
className={cn("relative", maximized || fill ? "flex-1 min-h-0" : "h-[560px]")}
|
||||
>
|
||||
<div
|
||||
ref={containerRef}
|
||||
className={cn("absolute inset-0 p-2", compact && "max-sm:p-0")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user