@@ -42,14 +42,12 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
4242 private readonly _onRestoreCommands = this . _register ( new Emitter < ISerializedCommandDetectionCapability > ( ) ) ;
4343 readonly onRestoreCommands = this . _onRestoreCommands . event ;
4444
45- get id ( ) : number { return this . _id ; }
46-
4745 constructor (
48- private _id : number ,
46+ readonly id : number ,
4947 readonly shouldPersist : boolean ,
5048 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
5351 ) {
5452 super ( ) ;
5553 this . _startBarrier = new Barrier ( ) ;
@@ -63,9 +61,9 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
6361 throw new Error ( 'Could not fetch remote environment' ) ;
6462 }
6563
66- this . _logService . trace ( 'Spawning remote agent process' , { terminalId : this . _id } ) ;
64+ this . _logService . trace ( 'Spawning remote agent process' , { terminalId : this . id } ) ;
6765
68- const startResult = await this . _remoteTerminalChannel . start ( this . _id ) ;
66+ const startResult = await this . _remoteTerminalChannel . start ( this . id ) ;
6967
7068 if ( startResult && 'message' in startResult ) {
7169 // An error occurred
@@ -83,7 +81,7 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
8381
8482 shutdown ( immediate : boolean ) : void {
8583 this . _startBarrier . wait ( ) . then ( _ => {
86- this . _remoteTerminalChannel . shutdown ( this . _id , immediate ) ;
84+ this . _remoteTerminalChannel . shutdown ( this . id , immediate ) ;
8785 } ) ;
8886 }
8987
@@ -93,7 +91,7 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
9391 }
9492
9593 this . _startBarrier . wait ( ) . then ( _ => {
96- this . _remoteTerminalChannel . input ( this . _id , data ) ;
94+ this . _remoteTerminalChannel . input ( this . id , data ) ;
9795 } ) ;
9896 }
9997
@@ -104,7 +102,7 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
104102 this . _startBarrier . wait ( ) . then ( _ => {
105103 this . _lastDimensions . cols = cols ;
106104 this . _lastDimensions . rows = rows ;
107- this . _remoteTerminalChannel . resize ( this . _id , cols , rows ) ;
105+ this . _remoteTerminalChannel . resize ( this . id , cols , rows ) ;
108106 } ) ;
109107 }
110108
@@ -126,12 +124,12 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
126124 }
127125
128126 this . _startBarrier . wait ( ) . then ( _ => {
129- this . _remoteTerminalChannel . acknowledgeDataEvent ( this . _id , charCount ) ;
127+ this . _remoteTerminalChannel . acknowledgeDataEvent ( this . id , charCount ) ;
130128 } ) ;
131129 }
132130
133131 async setUnicodeVersion ( version : '6' | '11' ) : Promise < void > {
134- return this . _remoteTerminalChannel . setUnicodeVersion ( this . _id , version ) ;
132+ return this . _remoteTerminalChannel . setUnicodeVersion ( this . id , version ) ;
135133 }
136134
137135 async getInitialCwd ( ) : Promise < string > {
@@ -143,11 +141,11 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
143141 }
144142
145143 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 ) ;
147145 }
148146
149147 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 ) ;
151149 }
152150
153151 handleData ( e : string | IProcessDataEvent ) {
@@ -157,7 +155,7 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
157155 this . _onProcessExit . fire ( e ) ;
158156 }
159157 processBinary ( e : string ) : Promise < void > {
160- return this . _remoteTerminalChannel . processBinary ( this . _id , e ) ;
158+ return this . _remoteTerminalChannel . processBinary ( this . id , e ) ;
161159 }
162160 handleReady ( e : IProcessReadyEvent ) {
163161 this . _onProcessReady . fire ( e ) ;
@@ -203,7 +201,7 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
203201 }
204202
205203 handleOrphanQuestion ( ) {
206- this . _remoteTerminalChannel . orphanQuestionReply ( this . _id ) ;
204+ this . _remoteTerminalChannel . orphanQuestionReply ( this . id ) ;
207205 }
208206
209207 async getLatency ( ) : Promise < number > {
0 commit comments