Skip to content

Commit 6ca11af

Browse files
committed
Fix #587
1 parent c9f91e7 commit 6ca11af

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/protocol/src/browser/modules/node-pty.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ interface ClientNodePtyProcessProxy extends NodePtyProcessProxy, ClientServerPro
99
export class NodePtyProcess extends ClientProxy<ClientNodePtyProcessProxy> implements pty.IPty {
1010
private _pid = -1;
1111
private _process = "";
12+
private lastCols: number | undefined;
13+
private lastRows: number | undefined;
1214

1315
public constructor(
1416
private readonly moduleProxy: ClientNodePtyModuleProxy,
@@ -37,6 +39,9 @@ export class NodePtyProcess extends ClientProxy<ClientNodePtyProcessProxy> imple
3739
}
3840

3941
public resize(columns: number, rows: number): void {
42+
this.lastCols = columns;
43+
this.lastRows = rows;
44+
4045
this.catch(this.proxy.resize(columns, rows));
4146
}
4247

@@ -51,7 +56,11 @@ export class NodePtyProcess extends ClientProxy<ClientNodePtyProcessProxy> imple
5156
protected handleDisconnect(): void {
5257
this._process += " (disconnected)";
5358
this.emit("data", "\r\n\nLost connection...\r\n\n");
54-
this.initialize(this.moduleProxy.spawn(this.file, this.args, this.options));
59+
this.initialize(this.moduleProxy.spawn(this.file, this.args, {
60+
...this.options,
61+
cols: this.lastCols || this.options.cols,
62+
rows: this.lastRows || this.options.rows,
63+
}));
5564
}
5665
}
5766

0 commit comments

Comments
 (0)