UNPKG

sussudio

Version:

An unofficial VS Code Internal API

61 lines (60 loc) 3.17 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { IShellIntegration, ShellIntegrationStatus } from "../terminal.mjs"; import { Disposable } from "../../../../base/common/lifecycle.mjs"; import { TerminalCapabilityStore } from "../capabilities/terminalCapabilityStore.mjs"; import { IBufferMarkCapability, ICommandDetectionCapability, ICwdDetectionCapability, ISerializedCommandDetectionCapability } from "../capabilities/capabilities.mjs"; import { ILogService } from "../../../log/common/log.mjs"; import { ITelemetryService } from "../../../telemetry/common/telemetry.mjs"; import type { ITerminalAddon, Terminal } from 'xterm-headless'; /** * The shell integration addon extends xterm by reading shell integration sequences and creating * capabilities and passing along relevant sequences to the capabilities. This is meant to * encapsulate all handling/parsing of sequences so the capabilities don't need to. */ export declare class ShellIntegrationAddon extends Disposable implements IShellIntegration, ITerminalAddon { private readonly _disableTelemetry; private readonly _telemetryService; private readonly _logService; private _terminal?; readonly capabilities: TerminalCapabilityStore; private _hasUpdatedTelemetry; private _activationTimeout; private _commonProtocolDisposables; private _status; get status(): ShellIntegrationStatus; private readonly _onDidChangeStatus; readonly onDidChangeStatus: import("../../../../base/common/event.mjs").Event<ShellIntegrationStatus>; constructor(_disableTelemetry: boolean | undefined, _telemetryService: ITelemetryService | undefined, _logService: ILogService); private _disposeCommonProtocol; activate(xterm: Terminal): void; private _handleFinalTermSequence; private _doHandleFinalTermSequence; private _handleVSCodeSequence; private _ensureCapabilitiesOrAddFailureTelemetry; private _clearActivationTimeout; private _doHandleVSCodeSequence; private _updateCwd; private _doHandleITermSequence; private _doHandleSetWindowsFriendlyCwd; /** * Handles the sequence: `OSC 7 ; scheme://cwd ST` */ private _doHandleSetCwd; serialize(): ISerializedCommandDetectionCapability; deserialize(serialized: ISerializedCommandDetectionCapability): void; protected _createOrGetCwdDetection(): ICwdDetectionCapability; protected _createOrGetCommandDetection(terminal: Terminal): ICommandDetectionCapability; protected _createOrGetBufferMarkDetection(terminal: Terminal): IBufferMarkCapability; } export declare function deserializeMessage(message: string): string; export declare function parseKeyValueAssignment(message: string): { key: string; value: string | undefined; }; export declare function parseMarkSequence(sequence: string[]): { id?: string; hidden?: boolean; };