Class TerminalWidgetAbstract

Terminal UI widget.

Hierarchy (view full)

Constructors

  • Parameters

    • Optional options: IOptions

    Returns TerminalWidget

Properties

dimensions: TerminalDimensions
envVarCollectionDescriptionsByExtension: Promise<Map<string, (undefined | string | MarkdownString)[]>>

The ids of extensions contributing to the environment of this terminal mapped to the provided description for their changes.

exitStatus: undefined | TerminalExitStatus
hiddenFromUser: boolean

Terminal widget can be hidden from users until explicitly shown once.

kind: string

Terminal kind that indicates whether a terminal is created by a user or by some extension for a user

lastCwd: URI

The last CWD assigned to the terminal, useful when attempting getCwdURI on a task terminal fails

The position of the terminal widget.

onData: Event<string>

Event that fires when the terminal input data

onDidOpen: Event<void>

Event that fires when the terminal is connected or reconnected

onDidOpenFailure: Event<void>

Event that fires when the terminal fails to connect or reconnect

onKey: Event<{
    domEvent: KeyboardEvent;
    key: string;
}>

Event that fires when the terminal receives a key event.

Type declaration

  • domEvent: KeyboardEvent
  • key: string
onOutput: Event<string>
onSizeChanged: Event<{
    cols: number;
    rows: number;
}>

Event that fires when the terminal size changed

Type declaration

  • cols: number
  • rows: number
onTerminalDidClose: Event<TerminalWidget>

Event which fires when terminal did closed. Event value contains closed terminal widget definition.

processId: Promise<number>
processInfo: Promise<TerminalProcessInfo>

Get the current executable and arguments.

terminalId: number

Methods

  • Resolves when the command is successfully sent, this doesn't mean that it was evaluated. Might reject if terminal wasn't properly started yet.

    Note that this method will try to escape your arguments as if it was someone inputting everything in a shell.

    Supported shells: bash, cmd.exe, wsl.exe, pwsh/powershell.exe

    Parameters

    • commandOptions: CommandLineOptions

    Returns Promise<void>