An individual terminal instance within the integrated terminal.

Fields

show(?preserveFocus:Bool):Void

Show the terminal panel and reveal this terminal in the UI.

Parameters:

preserveFocus

When true the terminal will not take focus.

sendText(text:String, ?addNewLine:Bool):Void

Send text to the terminal. The text is written to the stdin of the underlying pty process (shell) of the terminal.

Parameters:

text

The text to send.

addNewLine

Whether to add a new line to the text being sent, this is normally required to run a command in the terminal. The character(s) added are \n or \r\n depending on the platform. This defaults to true.

read onlyprocessId:Thenable<Null<Int>>

The process ID of the shell process.

read onlyname:String

The name of the terminal.

hide():Void

Hide the terminal panel if this terminal is currently showing.

@:optionaloptionalread onlyexitStatus:Null<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}`);
}
});

dispose():Void

Dispose and free associated resources.

read onlycreationOptions:EitherType<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.