@@ -221,8 +221,6 @@ export enum TerminalIpcChannels {
221
221
Heartbeat = 'heartbeat'
222
222
}
223
223
224
- export const IPtyService = createDecorator < IPtyService > ( 'ptyService' ) ;
225
-
226
224
export const enum ProcessPropertyType {
227
225
Cwd = 'cwd' ,
228
226
InitialCwd = 'initialCwd' ,
@@ -266,18 +264,8 @@ export interface IFixedTerminalDimensions {
266
264
rows ?: number ;
267
265
}
268
266
269
- export interface IPtyHostController {
270
- readonly onPtyHostExit ?: Event < number > ;
271
- readonly onPtyHostStart ?: Event < void > ;
272
- readonly onPtyHostUnresponsive ?: Event < void > ;
273
- readonly onPtyHostResponsive ?: Event < void > ;
274
- readonly onPtyHostRequestResolveVariables ?: Event < IRequestResolveVariablesEvent > ;
275
-
276
- restartPtyHost ?( ) : void ;
277
- acceptPtyHostResolvedVariables ?( requestId : number , resolved : string [ ] ) : Promise < void > ;
278
- }
279
-
280
- export interface IPtyService extends IPtyHostController {
267
+ export const IPtyService = createDecorator < IPtyService > ( 'ptyService' ) ;
268
+ export interface IPtyService {
281
269
readonly _serviceBrand : undefined ;
282
270
283
271
readonly onProcessData : Event < { id : number ; event : IProcessDataEvent | string } > ;
@@ -288,10 +276,6 @@ export interface IPtyService extends IPtyHostController {
288
276
readonly onDidChangeProperty : Event < { id : number ; property : IProcessProperty < any > } > ;
289
277
readonly onProcessExit : Event < { id : number ; event : number | undefined } > ;
290
278
291
- restartPtyHost ?( ) : Promise < void > ;
292
- shutdownAll ?( ) : Promise < void > ;
293
- acceptPtyHostResolvedVariables ?( requestId : number , resolved : string [ ] ) : Promise < void > ;
294
-
295
279
createProcess (
296
280
shellLaunchConfig : IShellLaunchConfig ,
297
281
cwd : string ,
@@ -307,6 +291,7 @@ export interface IPtyService extends IPtyHostController {
307
291
) : Promise < number > ;
308
292
attachToProcess ( id : number ) : Promise < void > ;
309
293
detachFromProcess ( id : number , forcePersist ?: boolean ) : Promise < void > ;
294
+ shutdownAll ( ) : Promise < void > ;
310
295
311
296
/**
312
297
* Lists all orphaned processes, ie. those without a connected frontend.
@@ -334,7 +319,6 @@ export interface IPtyService extends IPtyHostController {
334
319
uninstallAllAutoReplies ( ) : Promise < void > ;
335
320
uninstallAutoReply ( match : string ) : Promise < void > ;
336
321
getDefaultSystemShell ( osOverride ?: OperatingSystem ) : Promise < string > ;
337
- getProfiles ?( workspaceId : string , profiles : unknown , defaultProfile : unknown , includeDetectedProfiles ?: boolean ) : Promise < ITerminalProfile [ ] > ;
338
322
getEnvironment ( ) : Promise < IProcessEnvironment > ;
339
323
getWslPath ( original : string , direction : 'unix-to-win' | 'win-to-unix' ) : Promise < string > ;
340
324
getRevivedPtyNewId ( workspaceId : string , id : number ) : Promise < number | undefined > ;
@@ -343,7 +327,7 @@ export interface IPtyService extends IPtyHostController {
343
327
reduceConnectionGraceTime ( ) : Promise < void > ;
344
328
requestDetachInstance ( workspaceId : string , instanceId : number ) : Promise < IProcessDetails | undefined > ;
345
329
acceptDetachInstanceReply ( requestId : number , persistentProcessId ?: number ) : Promise < void > ;
346
- freePortKillProcess ? ( port : string ) : Promise < { port : string ; processId : string } > ;
330
+ freePortKillProcess ( port : string ) : Promise < { port : string ; processId : string } > ;
347
331
/**
348
332
* Serializes and returns terminal state.
349
333
* @param ids The persistent terminal IDs to serialize.
@@ -357,9 +341,26 @@ export interface IPtyService extends IPtyHostController {
357
341
refreshProperty < T extends ProcessPropertyType > ( id : number , property : T ) : Promise < IProcessPropertyMap [ T ] > ;
358
342
updateProperty < T extends ProcessPropertyType > ( id : number , property : T , value : IProcessPropertyMap [ T ] ) : Promise < void > ;
359
343
344
+ // TODO: Make mandatory and remove impl from pty host service
360
345
refreshIgnoreProcessNames ?( names : string [ ] ) : Promise < void > ;
361
346
}
362
347
348
+ export interface IPtyHostController {
349
+ readonly onPtyHostExit : Event < number > ;
350
+ readonly onPtyHostStart : Event < void > ;
351
+ readonly onPtyHostUnresponsive : Event < void > ;
352
+ readonly onPtyHostResponsive : Event < void > ;
353
+ readonly onPtyHostRequestResolveVariables : Event < IRequestResolveVariablesEvent > ;
354
+
355
+ restartPtyHost ( ) : Promise < void > ;
356
+ acceptPtyHostResolvedVariables ( requestId : number , resolved : string [ ] ) : Promise < void > ;
357
+ getProfiles ( workspaceId : string , profiles : unknown , defaultProfile : unknown , includeDetectedProfiles ?: boolean ) : Promise < ITerminalProfile [ ] > ;
358
+ }
359
+
360
+ export const IPtyHostService = createDecorator < IPtyHostService > ( 'ptyHostService' ) ;
361
+ export interface IPtyHostService extends IPtyService , IPtyHostController {
362
+ }
363
+
363
364
/**
364
365
* Serialized terminal state matching the interface that can be used across versions, the version
365
366
* should be verified before using the state payload.
@@ -1066,7 +1067,7 @@ export const ILocalPtyService = createDecorator<ILocalPtyService>('localPtyServi
1066
1067
*
1067
1068
* **This service should only be used within the terminal component.**
1068
1069
*/
1069
- export interface ILocalPtyService extends IPtyService { }
1070
+ export interface ILocalPtyService extends IPtyHostService { }
1070
1071
1071
1072
export const ITerminalLogService = createDecorator < ITerminalLogService > ( 'terminalLogService' ) ;
1072
1073
export interface ITerminalLogService extends ILogService {
0 commit comments