55
66import { Emitter } from 'vs/base/common/event' ;
77import { Disposable } from 'vs/base/common/lifecycle' ;
8- import { IProcessDataEvent , ITerminalChildProcess , ITerminalLaunchError , IProcessProperty , IProcessPropertyMap , ProcessPropertyType , IProcessReadyEvent , ILocalPtyService } from 'vs/platform/terminal/common/terminal' ;
8+ import { IProcessDataEvent , ITerminalChildProcess , ITerminalLaunchError , IProcessProperty , IProcessPropertyMap , ProcessPropertyType , IProcessReadyEvent , IPtyService } from 'vs/platform/terminal/common/terminal' ;
99import { URI } from 'vs/base/common/uri' ;
1010import { IPtyHostProcessReplayEvent , ISerializedCommandDetectionCapability } from 'vs/platform/terminal/common/capabilities/capabilities' ;
1111
@@ -46,48 +46,48 @@ export class LocalPty extends Disposable implements ITerminalChildProcess {
4646 constructor (
4747 readonly id : number ,
4848 readonly shouldPersist : boolean ,
49- @ ILocalPtyService private readonly _localPtyService : ILocalPtyService
49+ private readonly _proxy : IPtyService
5050 ) {
5151 super ( ) ;
5252 }
5353
5454 start ( ) : Promise < ITerminalLaunchError | { injectedArgs : string [ ] } | undefined > {
55- return this . _localPtyService . start ( this . id ) ;
55+ return this . _proxy . start ( this . id ) ;
5656 }
5757 detach ( forcePersist ?: boolean ) : Promise < void > {
58- return this . _localPtyService . detachFromProcess ( this . id , forcePersist ) ;
58+ return this . _proxy . detachFromProcess ( this . id , forcePersist ) ;
5959 }
6060 shutdown ( immediate : boolean ) : void {
61- this . _localPtyService . shutdown ( this . id , immediate ) ;
61+ this . _proxy . shutdown ( this . id , immediate ) ;
6262 }
6363 async processBinary ( data : string ) : Promise < void > {
6464 if ( this . _inReplay ) {
6565 return ;
6666 }
67- return this . _localPtyService . processBinary ( this . id , data ) ;
67+ return this . _proxy . processBinary ( this . id , data ) ;
6868 }
6969 input ( data : string ) : void {
7070 if ( this . _inReplay ) {
7171 return ;
7272 }
73- this . _localPtyService . input ( this . id , data ) ;
73+ this . _proxy . input ( this . id , data ) ;
7474 }
7575 resize ( cols : number , rows : number ) : void {
7676 if ( this . _inReplay || this . _lastDimensions . cols === cols && this . _lastDimensions . rows === rows ) {
7777 return ;
7878 }
7979 this . _lastDimensions . cols = cols ;
8080 this . _lastDimensions . rows = rows ;
81- this . _localPtyService . resize ( this . id , cols , rows ) ;
81+ this . _proxy . resize ( this . id , cols , rows ) ;
8282 }
8383 async clearBuffer ( ) : Promise < void > {
84- this . _localPtyService . clearBuffer ?.( this . id ) ;
84+ this . _proxy . clearBuffer ?.( this . id ) ;
8585 }
8686 freePortKillProcess ( port : string ) : Promise < { port : string ; processId : string } > {
87- if ( ! this . _localPtyService . freePortKillProcess ) {
87+ if ( ! this . _proxy . freePortKillProcess ) {
8888 throw new Error ( 'freePortKillProcess does not exist on the local pty service' ) ;
8989 }
90- return this . _localPtyService . freePortKillProcess ( port ) ;
90+ return this . _proxy . freePortKillProcess ( port ) ;
9191 }
9292 async getInitialCwd ( ) : Promise < string > {
9393 return this . _properties . initialCwd ;
@@ -96,23 +96,23 @@ export class LocalPty extends Disposable implements ITerminalChildProcess {
9696 return this . _properties . cwd || this . _properties . initialCwd ;
9797 }
9898 async refreshProperty < T extends ProcessPropertyType > ( type : T ) : Promise < IProcessPropertyMap [ T ] > {
99- return this . _localPtyService . refreshProperty ( this . id , type ) ;
99+ return this . _proxy . refreshProperty ( this . id , type ) ;
100100 }
101101 async updateProperty < T extends ProcessPropertyType > ( type : T , value : IProcessPropertyMap [ T ] ) : Promise < void > {
102- return this . _localPtyService . updateProperty ( this . id , type , value ) ;
102+ return this . _proxy . updateProperty ( this . id , type , value ) ;
103103 }
104104 getLatency ( ) : Promise < number > {
105105 // TODO: The idea here was to add the result plus the time it took to get the latency
106- return this . _localPtyService . getLatency ( this . id ) ;
106+ return this . _proxy . getLatency ( this . id ) ;
107107 }
108108 acknowledgeDataEvent ( charCount : number ) : void {
109109 if ( this . _inReplay ) {
110110 return ;
111111 }
112- this . _localPtyService . acknowledgeDataEvent ( this . id , charCount ) ;
112+ this . _proxy . acknowledgeDataEvent ( this . id , charCount ) ;
113113 }
114114 setUnicodeVersion ( version : '6' | '11' ) : Promise < void > {
115- return this . _localPtyService . setUnicodeVersion ( this . id , version ) ;
115+ return this . _proxy . setUnicodeVersion ( this . id , version ) ;
116116 }
117117
118118 handleData ( e : string | IProcessDataEvent ) {
@@ -165,6 +165,6 @@ export class LocalPty extends Disposable implements ITerminalChildProcess {
165165 }
166166
167167 handleOrphanQuestion ( ) {
168- this . _localPtyService . orphanQuestionReply ( this . id ) ;
168+ this . _proxy . orphanQuestionReply ( this . id ) ;
169169 }
170170}
0 commit comments