@@ -14,22 +14,8 @@ import { RemoteTerminalChannelClient } from 'vs/workbench/contrib/terminal/commo
1414import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService' ;
1515
1616export class RemotePty extends Disposable implements ITerminalChildProcess {
17- private readonly _onProcessData = this . _register ( new Emitter < string | IProcessDataEvent > ( ) ) ;
18- readonly onProcessData = this . _onProcessData . event ;
19- private readonly _onProcessReady = this . _register ( new Emitter < IProcessReadyEvent > ( ) ) ;
20- readonly onProcessReady = this . _onProcessReady . event ;
21- private readonly _onDidChangeProperty = this . _register ( new Emitter < IProcessProperty < any > > ( ) ) ;
22- readonly onDidChangeProperty = this . _onDidChangeProperty . event ;
23- private readonly _onProcessExit = this . _register ( new Emitter < number | undefined > ( ) ) ;
24- readonly onProcessExit = this . _onProcessExit . event ;
25- private readonly _onRestoreCommands = this . _register ( new Emitter < ISerializedCommandDetectionCapability > ( ) ) ;
26- readonly onRestoreCommands = this . _onRestoreCommands . event ;
27-
28- private _startBarrier : Barrier ;
29-
30- private _inReplay = false ;
31-
32- private _properties : IProcessPropertyMap = {
17+ private readonly _startBarrier : Barrier ;
18+ private readonly _properties : IProcessPropertyMap = {
3319 cwd : '' ,
3420 initialCwd : '' ,
3521 fixedDimensions : { cols : undefined , rows : undefined } ,
@@ -41,6 +27,20 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
4127 failedShellIntegrationActivation : false ,
4228 usedShellIntegrationInjection : undefined
4329 } ;
30+ private readonly _lastDimensions : { cols : number ; rows : number } = { cols : - 1 , rows : - 1 } ;
31+
32+ private _inReplay = false ;
33+
34+ private readonly _onProcessData = this . _register ( new Emitter < string | IProcessDataEvent > ( ) ) ;
35+ readonly onProcessData = this . _onProcessData . event ;
36+ private readonly _onProcessReady = this . _register ( new Emitter < IProcessReadyEvent > ( ) ) ;
37+ readonly onProcessReady = this . _onProcessReady . event ;
38+ private readonly _onDidChangeProperty = this . _register ( new Emitter < IProcessProperty < any > > ( ) ) ;
39+ readonly onDidChangeProperty = this . _onDidChangeProperty . event ;
40+ private readonly _onProcessExit = this . _register ( new Emitter < number | undefined > ( ) ) ;
41+ readonly onProcessExit = this . _onProcessExit . event ;
42+ private readonly _onRestoreCommands = this . _register ( new Emitter < ISerializedCommandDetectionCapability > ( ) ) ;
43+ readonly onRestoreCommands = this . _onRestoreCommands . event ;
4444
4545 get id ( ) : number { return this . _id ; }
4646
@@ -98,11 +98,12 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
9898 }
9999
100100 resize ( cols : number , rows : number ) : void {
101- if ( this . _inReplay ) {
101+ if ( this . _inReplay || this . _lastDimensions . cols === cols && this . _lastDimensions . rows === rows ) {
102102 return ;
103103 }
104104 this . _startBarrier . wait ( ) . then ( _ => {
105-
105+ this . _lastDimensions . cols = cols ;
106+ this . _lastDimensions . rows = rows ;
106107 this . _remoteTerminalChannel . resize ( this . _id , cols , rows ) ;
107108 } ) ;
108109 }
0 commit comments