@@ -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,10 @@ 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+ /**
268+ * A service that communicates with a pty host.
269+ */
270+ export interface IPtyService {
281271 readonly _serviceBrand : undefined ;
282272
283273 readonly onProcessData : Event < { id : number ; event : IProcessDataEvent | string } > ;
@@ -288,10 +278,6 @@ export interface IPtyService extends IPtyHostController {
288278 readonly onDidChangeProperty : Event < { id : number ; property : IProcessProperty < any > } > ;
289279 readonly onProcessExit : Event < { id : number ; event : number | undefined } > ;
290280
291- restartPtyHost ?( ) : Promise < void > ;
292- shutdownAll ?( ) : Promise < void > ;
293- acceptPtyHostResolvedVariables ?( requestId : number , resolved : string [ ] ) : Promise < void > ;
294-
295281 createProcess (
296282 shellLaunchConfig : IShellLaunchConfig ,
297283 cwd : string ,
@@ -307,6 +293,7 @@ export interface IPtyService extends IPtyHostController {
307293 ) : Promise < number > ;
308294 attachToProcess ( id : number ) : Promise < void > ;
309295 detachFromProcess ( id : number , forcePersist ?: boolean ) : Promise < void > ;
296+ shutdownAll ( ) : Promise < void > ;
310297
311298 /**
312299 * Lists all orphaned processes, ie. those without a connected frontend.
@@ -334,7 +321,6 @@ export interface IPtyService extends IPtyHostController {
334321 uninstallAllAutoReplies ( ) : Promise < void > ;
335322 uninstallAutoReply ( match : string ) : Promise < void > ;
336323 getDefaultSystemShell ( osOverride ?: OperatingSystem ) : Promise < string > ;
337- getProfiles ?( workspaceId : string , profiles : unknown , defaultProfile : unknown , includeDetectedProfiles ?: boolean ) : Promise < ITerminalProfile [ ] > ;
338324 getEnvironment ( ) : Promise < IProcessEnvironment > ;
339325 getWslPath ( original : string , direction : 'unix-to-win' | 'win-to-unix' ) : Promise < string > ;
340326 getRevivedPtyNewId ( workspaceId : string , id : number ) : Promise < number | undefined > ;
@@ -343,7 +329,7 @@ export interface IPtyService extends IPtyHostController {
343329 reduceConnectionGraceTime ( ) : Promise < void > ;
344330 requestDetachInstance ( workspaceId : string , instanceId : number ) : Promise < IProcessDetails | undefined > ;
345331 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 } > ;
347333 /**
348334 * Serializes and returns terminal state.
349335 * @param ids The persistent terminal IDs to serialize.
@@ -357,8 +343,29 @@ export interface IPtyService extends IPtyHostController {
357343 refreshProperty < T extends ProcessPropertyType > ( id : number , property : T ) : Promise < IProcessPropertyMap [ T ] > ;
358344 updateProperty < T extends ProcessPropertyType > ( id : number , property : T , value : IProcessPropertyMap [ T ] ) : Promise < void > ;
359345
346+ // TODO: Make mandatory and remove impl from pty host service
360347 refreshIgnoreProcessNames ?( names : string [ ] ) : Promise < void > ;
361348}
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+ }
362369
363370/**
364371 * Serialized terminal state matching the interface that can be used across versions, the version
@@ -1066,7 +1073,7 @@ export const ILocalPtyService = createDecorator<ILocalPtyService>('localPtyServi
10661073 *
10671074 * **This service should only be used within the terminal component.**
10681075 */
1069- export interface ILocalPtyService extends IPtyService { }
1076+ export interface ILocalPtyService extends IPtyHostService { }
10701077
10711078export const ITerminalLogService = createDecorator < ITerminalLogService > ( 'terminalLogService' ) ;
10721079export interface ITerminalLogService extends ILogService {
0 commit comments