5
5
6
6
import { Emitter } from 'vs/base/common/event' ;
7
7
import { 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' ;
9
9
import { URI } from 'vs/base/common/uri' ;
10
10
import { IPtyHostProcessReplayEvent , ISerializedCommandDetectionCapability } from 'vs/platform/terminal/common/capabilities/capabilities' ;
11
11
@@ -46,48 +46,48 @@ export class LocalPty extends Disposable implements ITerminalChildProcess {
46
46
constructor (
47
47
readonly id : number ,
48
48
readonly shouldPersist : boolean ,
49
- @ ILocalPtyService private readonly _localPtyService : ILocalPtyService
49
+ private readonly _proxy : IPtyService
50
50
) {
51
51
super ( ) ;
52
52
}
53
53
54
54
start ( ) : Promise < ITerminalLaunchError | { injectedArgs : string [ ] } | undefined > {
55
- return this . _localPtyService . start ( this . id ) ;
55
+ return this . _proxy . start ( this . id ) ;
56
56
}
57
57
detach ( forcePersist ?: boolean ) : Promise < void > {
58
- return this . _localPtyService . detachFromProcess ( this . id , forcePersist ) ;
58
+ return this . _proxy . detachFromProcess ( this . id , forcePersist ) ;
59
59
}
60
60
shutdown ( immediate : boolean ) : void {
61
- this . _localPtyService . shutdown ( this . id , immediate ) ;
61
+ this . _proxy . shutdown ( this . id , immediate ) ;
62
62
}
63
63
async processBinary ( data : string ) : Promise < void > {
64
64
if ( this . _inReplay ) {
65
65
return ;
66
66
}
67
- return this . _localPtyService . processBinary ( this . id , data ) ;
67
+ return this . _proxy . processBinary ( this . id , data ) ;
68
68
}
69
69
input ( data : string ) : void {
70
70
if ( this . _inReplay ) {
71
71
return ;
72
72
}
73
- this . _localPtyService . input ( this . id , data ) ;
73
+ this . _proxy . input ( this . id , data ) ;
74
74
}
75
75
resize ( cols : number , rows : number ) : void {
76
76
if ( this . _inReplay || this . _lastDimensions . cols === cols && this . _lastDimensions . rows === rows ) {
77
77
return ;
78
78
}
79
79
this . _lastDimensions . cols = cols ;
80
80
this . _lastDimensions . rows = rows ;
81
- this . _localPtyService . resize ( this . id , cols , rows ) ;
81
+ this . _proxy . resize ( this . id , cols , rows ) ;
82
82
}
83
83
async clearBuffer ( ) : Promise < void > {
84
- this . _localPtyService . clearBuffer ?.( this . id ) ;
84
+ this . _proxy . clearBuffer ?.( this . id ) ;
85
85
}
86
86
freePortKillProcess ( port : string ) : Promise < { port : string ; processId : string } > {
87
- if ( ! this . _localPtyService . freePortKillProcess ) {
87
+ if ( ! this . _proxy . freePortKillProcess ) {
88
88
throw new Error ( 'freePortKillProcess does not exist on the local pty service' ) ;
89
89
}
90
- return this . _localPtyService . freePortKillProcess ( port ) ;
90
+ return this . _proxy . freePortKillProcess ( port ) ;
91
91
}
92
92
async getInitialCwd ( ) : Promise < string > {
93
93
return this . _properties . initialCwd ;
@@ -96,23 +96,23 @@ export class LocalPty extends Disposable implements ITerminalChildProcess {
96
96
return this . _properties . cwd || this . _properties . initialCwd ;
97
97
}
98
98
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 ) ;
100
100
}
101
101
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 ) ;
103
103
}
104
104
getLatency ( ) : Promise < number > {
105
105
// 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 ) ;
107
107
}
108
108
acknowledgeDataEvent ( charCount : number ) : void {
109
109
if ( this . _inReplay ) {
110
110
return ;
111
111
}
112
- this . _localPtyService . acknowledgeDataEvent ( this . id , charCount ) ;
112
+ this . _proxy . acknowledgeDataEvent ( this . id , charCount ) ;
113
113
}
114
114
setUnicodeVersion ( version : '6' | '11' ) : Promise < void > {
115
- return this . _localPtyService . setUnicodeVersion ( this . id , version ) ;
115
+ return this . _proxy . setUnicodeVersion ( this . id , version ) ;
116
116
}
117
117
118
118
handleData ( e : string | IProcessDataEvent ) {
@@ -165,6 +165,6 @@ export class LocalPty extends Disposable implements ITerminalChildProcess {
165
165
}
166
166
167
167
handleOrphanQuestion ( ) {
168
- this . _localPtyService . orphanQuestionReply ( this . id ) ;
168
+ this . _proxy . orphanQuestionReply ( this . id ) ;
169
169
}
170
170
}
0 commit comments