@@ -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,10 @@ 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
+ /**
268
+ * A service that communicates with a pty host.
269
+ */
270
+ export interface IPtyService {
281
271
readonly _serviceBrand : undefined ;
282
272
283
273
readonly onProcessData : Event < { id : number ; event : IProcessDataEvent | string } > ;
@@ -288,10 +278,6 @@ export interface IPtyService extends IPtyHostController {
288
278
readonly onDidChangeProperty : Event < { id : number ; property : IProcessProperty < any > } > ;
289
279
readonly onProcessExit : Event < { id : number ; event : number | undefined } > ;
290
280
291
- restartPtyHost ?( ) : Promise < void > ;
292
- shutdownAll ?( ) : Promise < void > ;
293
- acceptPtyHostResolvedVariables ?( requestId : number , resolved : string [ ] ) : Promise < void > ;
294
-
295
281
createProcess (
296
282
shellLaunchConfig : IShellLaunchConfig ,
297
283
cwd : string ,
@@ -307,6 +293,7 @@ export interface IPtyService extends IPtyHostController {
307
293
) : Promise < number > ;
308
294
attachToProcess ( id : number ) : Promise < void > ;
309
295
detachFromProcess ( id : number , forcePersist ?: boolean ) : Promise < void > ;
296
+ shutdownAll ( ) : Promise < void > ;
310
297
311
298
/**
312
299
* Lists all orphaned processes, ie. those without a connected frontend.
@@ -334,7 +321,6 @@ export interface IPtyService extends IPtyHostController {
334
321
uninstallAllAutoReplies ( ) : Promise < void > ;
335
322
uninstallAutoReply ( match : string ) : Promise < void > ;
336
323
getDefaultSystemShell ( osOverride ?: OperatingSystem ) : Promise < string > ;
337
- getProfiles ?( workspaceId : string , profiles : unknown , defaultProfile : unknown , includeDetectedProfiles ?: boolean ) : Promise < ITerminalProfile [ ] > ;
338
324
getEnvironment ( ) : Promise < IProcessEnvironment > ;
339
325
getWslPath ( original : string , direction : 'unix-to-win' | 'win-to-unix' ) : Promise < string > ;
340
326
getRevivedPtyNewId ( workspaceId : string , id : number ) : Promise < number | undefined > ;
@@ -343,7 +329,7 @@ export interface IPtyService extends IPtyHostController {
343
329
reduceConnectionGraceTime ( ) : Promise < void > ;
344
330
requestDetachInstance ( workspaceId : string , instanceId : number ) : Promise < IProcessDetails | undefined > ;
345
331
acceptDetachInstanceReply ( requestId : number , persistentProcessId ?: number ) : Promise < void > ;
346
- freePortKillProcess ? ( port : string ) : Promise < { port : string ; processId : string } > ;
332
+ freePortKillProcess ( port : string ) : Promise < { port : string ; processId : string } > ;
347
333
/**
348
334
* Serializes and returns terminal state.
349
335
* @param ids The persistent terminal IDs to serialize.
@@ -357,8 +343,29 @@ export interface IPtyService extends IPtyHostController {
357
343
refreshProperty < T extends ProcessPropertyType > ( id : number , property : T ) : Promise < IProcessPropertyMap [ T ] > ;
358
344
updateProperty < T extends ProcessPropertyType > ( id : number , property : T , value : IProcessPropertyMap [ T ] ) : Promise < void > ;
359
345
346
+ // TODO: Make mandatory and remove impl from pty host service
360
347
refreshIgnoreProcessNames ?( names : string [ ] ) : Promise < void > ;
361
348
}
349
+ export const IPtyService = createDecorator < IPtyService > ( 'ptyService' ) ;
350
+
351
+ export interface IPtyHostController {
352
+ readonly onPtyHostExit : Event < number > ;
353
+ readonly onPtyHostStart : Event < void > ;
354
+ readonly onPtyHostUnresponsive : Event < void > ;
355
+ readonly onPtyHostResponsive : Event < void > ;
356
+ readonly onPtyHostRequestResolveVariables : Event < IRequestResolveVariablesEvent > ;
357
+
358
+ restartPtyHost ( ) : Promise < void > ;
359
+ acceptPtyHostResolvedVariables ( requestId : number , resolved : string [ ] ) : Promise < void > ;
360
+ getProfiles ( workspaceId : string , profiles : unknown , defaultProfile : unknown , includeDetectedProfiles ?: boolean ) : Promise < ITerminalProfile [ ] > ;
361
+ }
362
+
363
+ /**
364
+ * A service that communicates with a pty host controller (eg. main or server
365
+ * process) and is able to launch and forward requests to the pty host.
366
+ */
367
+ export interface IPtyHostService extends IPtyService , IPtyHostController {
368
+ }
362
369
363
370
/**
364
371
* Serialized terminal state matching the interface that can be used across versions, the version
@@ -1066,7 +1073,7 @@ export const ILocalPtyService = createDecorator<ILocalPtyService>('localPtyServi
1066
1073
*
1067
1074
* **This service should only be used within the terminal component.**
1068
1075
*/
1069
- export interface ILocalPtyService extends IPtyService { }
1076
+ export interface ILocalPtyService extends IPtyHostService { }
1070
1077
1071
1078
export const ITerminalLogService = createDecorator < ITerminalLogService > ( 'terminalLogService' ) ;
1072
1079
export interface ITerminalLogService extends ILogService {
0 commit comments