@@ -14,22 +14,8 @@ import { RemoteTerminalChannelClient } from 'vs/workbench/contrib/terminal/commo
14
14
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService' ;
15
15
16
16
export 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 = {
33
19
cwd : '' ,
34
20
initialCwd : '' ,
35
21
fixedDimensions : { cols : undefined , rows : undefined } ,
@@ -41,6 +27,20 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
41
27
failedShellIntegrationActivation : false ,
42
28
usedShellIntegrationInjection : undefined
43
29
} ;
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 ;
44
44
45
45
get id ( ) : number { return this . _id ; }
46
46
@@ -98,11 +98,12 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
98
98
}
99
99
100
100
resize ( cols : number , rows : number ) : void {
101
- if ( this . _inReplay ) {
101
+ if ( this . _inReplay || this . _lastDimensions . cols === cols && this . _lastDimensions . rows === rows ) {
102
102
return ;
103
103
}
104
104
this . _startBarrier . wait ( ) . then ( _ => {
105
-
105
+ this . _lastDimensions . cols = cols ;
106
+ this . _lastDimensions . rows = rows ;
106
107
this . _remoteTerminalChannel . resize ( this . _id , cols , rows ) ;
107
108
} ) ;
108
109
}
0 commit comments