Skip to content

Commit

Permalink
Fix bug where term resizing was ignored during SSH connect
Browse files Browse the repository at this point in the history
  • Loading branch information
sedwards2009 committed Dec 23, 2024
1 parent ec4f08f commit fa7d1ab
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions extensions/SSHSessionBackend/src/SSHPty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export class SSHPty implements Pty {
onExit: Event<void>;
onAvailableWriteBufferSizeChange: Event<BufferSizeChange>;

#preliveRows = 0;
#preliveCols = 0;

constructor(log: Logger, options: PtyOptions) {
this._log = log;
this.#ptyOptions = options;
Expand Down Expand Up @@ -154,6 +157,10 @@ export class SSHPty implements Pty {
});

this.#state = PtyState.LIVE;

if (this.#preliveRows !== 0) {
this.#stream.setWindow(this.#preliveRows, this.#preliveCols, 0, 0);
}
});
});

Expand Down Expand Up @@ -486,6 +493,8 @@ export class SSHPty implements Pty {

resize(cols: number, rows: number): void {
if (this.#state !== PtyState.LIVE) {
this.#preliveCols = cols;
this.#preliveRows = rows;
return;
}
this.#stream.setWindow(rows, cols, 0, 0);
Expand Down

0 comments on commit fa7d1ab

Please sign in to comment.