Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion src/unixTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,13 @@ export class UnixTerminal extends Terminal {
}
const pixelWidth = pixelSize?.width ?? 0;
const pixelHeight = pixelSize?.height ?? 0;
pty.resize(this._fd, cols, rows, pixelWidth, pixelHeight);
try {
pty.resize(this._fd, cols, rows, pixelWidth, pixelHeight);
} catch (e: any) {
// EBADF means the fd is already closed (PTY destroyed before resize fires); ignore it
if (e?.code === 'EBADF' || e?.message?.includes('EBADF')) { return; }
throw e;
}
this._cols = cols;
this._rows = rows;
}
Expand Down
2 changes: 1 addition & 1 deletion src/windowsPtyAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class WindowsPtyAgent {

public resize(cols: number, rows: number): void {
if (this._exitCode !== undefined) {
throw new Error('Cannot resize a pty that has already exited');
return;
}
this._ptyNative.resize(this._pty, cols, rows, this._useConptyDll);
}
Expand Down