Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Terminal

Definition of the terminal emulator.

Hierarchy

  • Terminal

Index

Properties

creationOptions: Readonly<TerminalOptions | ExtensionTerminalOptions>

The object used to initialize the terminal, this is useful for example to detecting the shell type of when the terminal was not launched by this extension or for detecting what folder the shell was launched in.

exitStatus: undefined | TerminalExitStatus

The exit status of the terminal, this will be undefined while the terminal is active.

Example: Show a notification with the exit code when the terminal exits with a non-zero exit code.

window.onDidCloseTerminal(t => {
if (t.exitStatus && t.exitStatus.code) {
vscode.window.showInformationMessage(`Exit code: ${t.exitStatus.code}`);
}
});
name: string

Human readable representation of the terminal in the UI.

processId: Thenable<number>

Terminal id.

The current state of the Terminal.

Methods

  • dispose(): void
  • hide(): void
  • sendText(text: string, addNewLine?: boolean): void
  • Send text to the terminal.

    Parameters

    • text: string

      text content.

    • Optional addNewLine: boolean

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

    Returns void

  • show(preserveFocus?: boolean): void
  • Show created terminal on the UI.

    Parameters

    • Optional preserveFocus: boolean

      in case true - set up focus on the terminal widget, otherwise show terminal without focus.

    Returns void