Interface TerminalServiceMain

interface TerminalServiceMain {
    $createTerminal(id, options, parentId?, isPseudoTerminal?): Promise<string>;
    $dispose(id): void;
    $disposeByTerminalId(id, waitOnExit?): void;
    $hide(id): void;
    $hideByTerminalId(id): void;
    $registerTerminalLinkProvider(providerId): Promise<void>;
    $registerTerminalObserver(id, nrOfLinesToMatch, outputMatcherRegex): unknown;
    $resize(id, cols, rows): void;
    $resizeByTerminalId(id, cols, rows): void;
    $sendText(id, text, shouldExecute?): void;
    $sendTextByTerminalId(id, text, addNewLine?): void;
    $setEnvironmentVariableCollection(persistent, extensionIdentifier, rootUri, collection): void;
    $setName(id, name): void;
    $setNameByTerminalId(id, name): void;
    $show(id, preserveFocus?): void;
    $showByTerminalId(id, preserveFocus?): void;
    $unregisterTerminalLinkProvider(providerId): Promise<void>;
    $unregisterTerminalObserver(id): unknown;
    $write(id, data): void;
    $writeByTerminalId(id, data): void;
}

Implemented by

Methods

  • Create new Terminal with Terminal options.

    Parameters

    • id: string
    • options: TerminalOptions

      object with parameters to create new terminal.

    • Optional parentId: string
    • Optional isPseudoTerminal: boolean

    Returns Promise<string>

  • Destroy terminal.

    Parameters

    • id: number

      terminal id.

    • Optional waitOnExit: string | boolean

      Whether to wait for a key press before closing the terminal.

    Returns void

  • Register a new terminal observer.

    Parameters

    • id: string
    • nrOfLinesToMatch: number

      the number of lines to match the outputMatcherRegex against

    • outputMatcherRegex: string

      the regex to match the output to

    Returns unknown

  • Send text to the terminal by id.

    Parameters

    • id: string

      terminal widget id.

    • text: string

      text content.

    • Optional shouldExecute: boolean

      in case true - Indicates that the text being sent should be executed rather than just inserted in the terminal.

    Returns void

  • Send text to the terminal by id.

    Parameters

    • id: number

      terminal id.

    • text: string

      text content.

    • Optional addNewLine: boolean

      in case true - add new line after the text, otherwise - don't apply new line.

    Returns void

  • Parameters

    • persistent: boolean
    • extensionIdentifier: string
    • rootUri: string
    • collection: SerializableEnvironmentVariableCollection

    Returns void

  • Show terminal on the UI panel.

    Parameters

    • id: string

      terminal widget id.

    • Optional preserveFocus: boolean

      set terminal focus in case true value, and don't set focus otherwise.

    Returns void

  • Show terminal on the UI panel.

    Parameters

    • id: number

      terminal id.

    • Optional preserveFocus: boolean

      set terminal focus in case true value, and don't set focus otherwise.

    Returns void

  • Unregister the terminal link provider with the specified id.

    Parameters

    • providerId: string

      id of the terminal link provider to be unregistered.

    Returns Promise<void>