import { Event } from "../../../base/common/event.js"; import * as performance from "../../../base/common/performance.js"; import { IProcessEnvironment, OperatingSystem } from "../../../base/common/platform.js"; import { ILogService } from "../../log/common/log.service.js"; import { IPtyHostProcessReplayEvent } from "./capabilities/capabilities.js"; import { IProcessDataEvent, IProcessReadyEvent, IProcessProperty, IShellLaunchConfig, ITerminalProcessOptions, IPtyHostLatencyMeasurement, ITerminalLaunchError, ITerminalLaunchResult, TitleEventSource, TerminalIcon, ITerminalsLayoutInfo, ISerializedTerminalState, ProcessPropertyType, IProcessPropertyMap, type IPtyHostService } from "./terminal.js"; import { IProcessDetails, ISetTerminalLayoutInfoArgs, IGetTerminalLayoutInfoArgs } from "./terminalProcess.js"; /** * A service that communicates with a pty host. */ export interface IPtyService { readonly _serviceBrand: undefined; readonly onProcessData: Event<{ id: number; event: IProcessDataEvent | string; }>; readonly onProcessReady: Event<{ id: number; event: IProcessReadyEvent; }>; readonly onProcessReplay: Event<{ id: number; event: IPtyHostProcessReplayEvent; }>; readonly onProcessOrphanQuestion: Event<{ id: number; }>; readonly onDidRequestDetach: Event<{ requestId: number; workspaceId: string; instanceId: number; }>; readonly onDidChangeProperty: Event<{ id: number; property: IProcessProperty; }>; readonly onProcessExit: Event<{ id: number; event: number | undefined; }>; createProcess(shellLaunchConfig: IShellLaunchConfig, cwd: string, cols: number, rows: number, unicodeVersion: "6" | "11", env: IProcessEnvironment, executableEnv: IProcessEnvironment, options: ITerminalProcessOptions, shouldPersist: boolean, workspaceId: string, workspaceName: string): Promise; attachToProcess(id: number): Promise; detachFromProcess(id: number, forcePersist?: boolean): Promise; shutdownAll(): Promise; /** * Lists all orphaned processes, ie. those without a connected frontend. */ listProcesses(): Promise; getPerformanceMarks(): Promise; /** * Measures and returns the latency of the current and all other processes to the pty host. */ getLatency(): Promise; start(id: number): Promise; shutdown(id: number, immediate: boolean): Promise; input(id: number, data: string): Promise; sendSignal(id: number, signal: string): Promise; resize(id: number, cols: number, rows: number, pixelWidth?: number, pixelHeight?: number): Promise; clearBuffer(id: number): Promise; getInitialCwd(id: number): Promise; getCwd(id: number): Promise; acknowledgeDataEvent(id: number, charCount: number): Promise; setNextCommandId(id: number, commandLine: string, commandId: string): Promise; setUnicodeVersion(id: number, version: "6" | "11"): Promise; processBinary(id: number, data: string): Promise; /** Confirm the process is _not_ an orphan. */ orphanQuestionReply(id: number): Promise; updateTitle(id: number, title: string, titleSource: TitleEventSource): Promise; updateIcon(id: number, userInitiated: boolean, icon: TerminalIcon, color?: string): Promise; getDefaultSystemShell(osOverride?: OperatingSystem): Promise; getEnvironment(): Promise; getWslPath(original: string, direction: "unix-to-win" | "win-to-unix"): Promise; getRevivedPtyNewId(workspaceId: string, id: number): Promise; setTerminalLayoutInfo(args: ISetTerminalLayoutInfoArgs): Promise; getTerminalLayoutInfo(args: IGetTerminalLayoutInfoArgs): Promise; reduceConnectionGraceTime(): Promise; requestDetachInstance(workspaceId: string, instanceId: number): Promise; acceptDetachInstanceReply(requestId: number, persistentProcessId?: number): Promise; freePortKillProcess(port: string): Promise<{ port: string; processId: string; }>; /** * Serializes and returns terminal state. * @param ids The persistent terminal IDs to serialize. */ serializeTerminalState(ids: number[]): Promise; /** * Revives a workspaces terminal processes, these can then be reconnected to using the normal * flow for restoring terminals after reloading. */ reviveTerminalProcesses(workspaceId: string, state: ISerializedTerminalState[], dateTimeFormatLocate: string): Promise; refreshProperty(id: number, property: T): Promise; updateProperty(id: number, property: T, value: IProcessPropertyMap[T]): Promise; refreshIgnoreProcessNames?(names: string[]): Promise; installAutoReply(match: string, reply: string): Promise; uninstallAllAutoReplies(): Promise; } export declare const IPtyService: import("../../instantiation/common/instantiation.js").ServiceIdentifier; export declare const ILocalPtyService: import("../../instantiation/common/instantiation.js").ServiceIdentifier; /** * A service responsible for communicating with the pty host process on Electron. * * **This service should only be used within the terminal component.** */ export interface ILocalPtyService extends IPtyHostService { } export declare const ITerminalLogService: import("../../instantiation/common/instantiation.js").ServiceIdentifier; export interface ITerminalLogService extends ILogService { /** * Similar to _serviceBrand but used to differentiate this service at compile time from * ILogService; ITerminalLogService is an ILogService, but ILogService is not an * ITerminalLogService. */ readonly _logBrand: undefined; }