Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions apps/desktop/src/renderer/lib/terminal/terminal-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ function hostIsVisible(container: HTMLDivElement | null): boolean {
function measureAndResize(
runtime: TerminalRuntime,
onResize?: () => void,
options: { forceNotify?: boolean } = {},
): void {
if (!hostIsVisible(runtime.container)) return;
const { terminal } = runtime;
Expand Down Expand Up @@ -165,7 +166,11 @@ function measureAndResize(

terminal.refresh(0, Math.max(0, terminal.rows - 1));

if (terminal.cols !== prevCols || terminal.rows !== prevRows) {
if (
options.forceNotify ||
terminal.cols !== prevCols ||
terminal.rows !== prevRows
) {
onResize?.();
}
});
Expand All @@ -189,7 +194,10 @@ function createResizeScheduler(

const run = () => {
timeoutId = null;
measureAndResize(runtime, onResize);
// Notify unconditionally (VS Code parity): a reveal after a zero-size
// hide re-sends PTY dims even when unchanged, resyncing a PTY resized
// elsewhere meanwhile. Same-size re-sends are kernel no-ops.
measureAndResize(runtime, onResize, { forceNotify: true });
};

const observe: ResizeObserverCallback = (entries) => {
Expand Down
Loading