@@ -42,14 +42,12 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
42
42
private readonly _onRestoreCommands = this . _register ( new Emitter < ISerializedCommandDetectionCapability > ( ) ) ;
43
43
readonly onRestoreCommands = this . _onRestoreCommands . event ;
44
44
45
- get id ( ) : number { return this . _id ; }
46
-
47
45
constructor (
48
- private _id : number ,
46
+ readonly id : number ,
49
47
readonly shouldPersist : boolean ,
50
48
private readonly _remoteTerminalChannel : RemoteTerminalChannelClient ,
51
- private readonly _remoteAgentService : IRemoteAgentService ,
52
- private readonly _logService : ILogService
49
+ @ IRemoteAgentService private readonly _remoteAgentService : IRemoteAgentService ,
50
+ @ ILogService private readonly _logService : ILogService
53
51
) {
54
52
super ( ) ;
55
53
this . _startBarrier = new Barrier ( ) ;
@@ -63,9 +61,9 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
63
61
throw new Error ( 'Could not fetch remote environment' ) ;
64
62
}
65
63
66
- this . _logService . trace ( 'Spawning remote agent process' , { terminalId : this . _id } ) ;
64
+ this . _logService . trace ( 'Spawning remote agent process' , { terminalId : this . id } ) ;
67
65
68
- const startResult = await this . _remoteTerminalChannel . start ( this . _id ) ;
66
+ const startResult = await this . _remoteTerminalChannel . start ( this . id ) ;
69
67
70
68
if ( startResult && 'message' in startResult ) {
71
69
// An error occurred
@@ -83,7 +81,7 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
83
81
84
82
shutdown ( immediate : boolean ) : void {
85
83
this . _startBarrier . wait ( ) . then ( _ => {
86
- this . _remoteTerminalChannel . shutdown ( this . _id , immediate ) ;
84
+ this . _remoteTerminalChannel . shutdown ( this . id , immediate ) ;
87
85
} ) ;
88
86
}
89
87
@@ -93,7 +91,7 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
93
91
}
94
92
95
93
this . _startBarrier . wait ( ) . then ( _ => {
96
- this . _remoteTerminalChannel . input ( this . _id , data ) ;
94
+ this . _remoteTerminalChannel . input ( this . id , data ) ;
97
95
} ) ;
98
96
}
99
97
@@ -104,7 +102,7 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
104
102
this . _startBarrier . wait ( ) . then ( _ => {
105
103
this . _lastDimensions . cols = cols ;
106
104
this . _lastDimensions . rows = rows ;
107
- this . _remoteTerminalChannel . resize ( this . _id , cols , rows ) ;
105
+ this . _remoteTerminalChannel . resize ( this . id , cols , rows ) ;
108
106
} ) ;
109
107
}
110
108
@@ -126,12 +124,12 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
126
124
}
127
125
128
126
this . _startBarrier . wait ( ) . then ( _ => {
129
- this . _remoteTerminalChannel . acknowledgeDataEvent ( this . _id , charCount ) ;
127
+ this . _remoteTerminalChannel . acknowledgeDataEvent ( this . id , charCount ) ;
130
128
} ) ;
131
129
}
132
130
133
131
async setUnicodeVersion ( version : '6' | '11' ) : Promise < void > {
134
- return this . _remoteTerminalChannel . setUnicodeVersion ( this . _id , version ) ;
132
+ return this . _remoteTerminalChannel . setUnicodeVersion ( this . id , version ) ;
135
133
}
136
134
137
135
async getInitialCwd ( ) : Promise < string > {
@@ -143,11 +141,11 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
143
141
}
144
142
145
143
async refreshProperty < T extends ProcessPropertyType > ( type : T ) : Promise < IProcessPropertyMap [ T ] > {
146
- return this . _remoteTerminalChannel . refreshProperty ( this . _id , type ) ;
144
+ return this . _remoteTerminalChannel . refreshProperty ( this . id , type ) ;
147
145
}
148
146
149
147
async updateProperty < T extends ProcessPropertyType > ( type : T , value : IProcessPropertyMap [ T ] ) : Promise < void > {
150
- return this . _remoteTerminalChannel . updateProperty ( this . _id , type , value ) ;
148
+ return this . _remoteTerminalChannel . updateProperty ( this . id , type , value ) ;
151
149
}
152
150
153
151
handleData ( e : string | IProcessDataEvent ) {
@@ -157,7 +155,7 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
157
155
this . _onProcessExit . fire ( e ) ;
158
156
}
159
157
processBinary ( e : string ) : Promise < void > {
160
- return this . _remoteTerminalChannel . processBinary ( this . _id , e ) ;
158
+ return this . _remoteTerminalChannel . processBinary ( this . id , e ) ;
161
159
}
162
160
handleReady ( e : IProcessReadyEvent ) {
163
161
this . _onProcessReady . fire ( e ) ;
@@ -203,7 +201,7 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
203
201
}
204
202
205
203
handleOrphanQuestion ( ) {
206
- this . _remoteTerminalChannel . orphanQuestionReply ( this . _id ) ;
204
+ this . _remoteTerminalChannel . orphanQuestionReply ( this . id ) ;
207
205
}
208
206
209
207
async getLatency ( ) : Promise < number > {
0 commit comments