@@ -221,8 +221,6 @@ export enum TerminalIpcChannels {
221221 Heartbeat = 'heartbeat'
222222}
223223
224- export const IPtyService = createDecorator < IPtyService > ( 'ptyService' ) ;
225-
226224export const enum ProcessPropertyType {
227225 Cwd = 'cwd' ,
228226 InitialCwd = 'initialCwd' ,
@@ -266,18 +264,8 @@ export interface IFixedTerminalDimensions {
266264 rows ?: number ;
267265}
268266
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 {
281269 readonly _serviceBrand : undefined ;
282270
283271 readonly onProcessData : Event < { id : number ; event : IProcessDataEvent | string } > ;
@@ -288,10 +276,6 @@ export interface IPtyService extends IPtyHostController {
288276 readonly onDidChangeProperty : Event < { id : number ; property : IProcessProperty < any > } > ;
289277 readonly onProcessExit : Event < { id : number ; event : number | undefined } > ;
290278
291- restartPtyHost ?( ) : Promise < void > ;
292- shutdownAll ?( ) : Promise < void > ;
293- acceptPtyHostResolvedVariables ?( requestId : number , resolved : string [ ] ) : Promise < void > ;
294-
295279 createProcess (
296280 shellLaunchConfig : IShellLaunchConfig ,
297281 cwd : string ,
@@ -307,6 +291,7 @@ export interface IPtyService extends IPtyHostController {
307291 ) : Promise < number > ;
308292 attachToProcess ( id : number ) : Promise < void > ;
309293 detachFromProcess ( id : number , forcePersist ?: boolean ) : Promise < void > ;
294+ shutdownAll ( ) : Promise < void > ;
310295
311296 /**
312297 * Lists all orphaned processes, ie. those without a connected frontend.
@@ -334,7 +319,6 @@ export interface IPtyService extends IPtyHostController {
334319 uninstallAllAutoReplies ( ) : Promise < void > ;
335320 uninstallAutoReply ( match : string ) : Promise < void > ;
336321 getDefaultSystemShell ( osOverride ?: OperatingSystem ) : Promise < string > ;
337- getProfiles ?( workspaceId : string , profiles : unknown , defaultProfile : unknown , includeDetectedProfiles ?: boolean ) : Promise < ITerminalProfile [ ] > ;
338322 getEnvironment ( ) : Promise < IProcessEnvironment > ;
339323 getWslPath ( original : string , direction : 'unix-to-win' | 'win-to-unix' ) : Promise < string > ;
340324 getRevivedPtyNewId ( workspaceId : string , id : number ) : Promise < number | undefined > ;
@@ -343,7 +327,7 @@ export interface IPtyService extends IPtyHostController {
343327 reduceConnectionGraceTime ( ) : Promise < void > ;
344328 requestDetachInstance ( workspaceId : string , instanceId : number ) : Promise < IProcessDetails | undefined > ;
345329 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 } > ;
347331 /**
348332 * Serializes and returns terminal state.
349333 * @param ids The persistent terminal IDs to serialize.
@@ -357,9 +341,26 @@ export interface IPtyService extends IPtyHostController {
357341 refreshProperty < T extends ProcessPropertyType > ( id : number , property : T ) : Promise < IProcessPropertyMap [ T ] > ;
358342 updateProperty < T extends ProcessPropertyType > ( id : number , property : T , value : IProcessPropertyMap [ T ] ) : Promise < void > ;
359343
344+ // TODO: Make mandatory and remove impl from pty host service
360345 refreshIgnoreProcessNames ?( names : string [ ] ) : Promise < void > ;
361346}
362347
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+
363364/**
364365 * Serialized terminal state matching the interface that can be used across versions, the version
365366 * should be verified before using the state payload.
@@ -1066,7 +1067,7 @@ export const ILocalPtyService = createDecorator<ILocalPtyService>('localPtyServi
10661067 *
10671068 * **This service should only be used within the terminal component.**
10681069 */
1069- export interface ILocalPtyService extends IPtyService { }
1070+ export interface ILocalPtyService extends IPtyHostService { }
10701071
10711072export const ITerminalLogService = createDecorator < ITerminalLogService > ( 'terminalLogService' ) ;
10721073export interface ITerminalLogService extends ILogService {
0 commit comments