From 26510e7c158fa41170f170d45cc8642fa1741402 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 11 Feb 2020 05:35:21 -0800 Subject: [PATCH] Make Terminal.exitStatus stable API Fixes #62103 --- src/vs/vscode.d.ts | 29 +++++++++++++++++++++++++++++ src/vs/vscode.proposed.d.ts | 32 -------------------------------- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index a3fee3e8144..c2aad774b55 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -4930,6 +4930,21 @@ declare module 'vscode' { */ readonly creationOptions: Readonly; + /** + * 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. + * ```typescript + * window.onDidCloseTerminal(t => { + * if (t.exitStatus && t.exitStatus.code) { + * vscode.window.showInformationMessage(`Exit code: ${t.exitStatus.code}`); + * } + * }); + * ``` + */ + readonly exitStatus: TerminalExitStatus | undefined; + /** * Send text to the terminal. The text is written to the stdin of the underlying pty process * (shell) of the terminal. @@ -7746,6 +7761,20 @@ declare module 'vscode' { readonly rows: number; } + /** + * Represents how a terminal exited. + */ + export interface TerminalExitStatus { + /** + * The exit code that a terminal exited with, it can have the following values: + * - Zero: the terminal process or custom execution succeeded. + * - Non-zero: the terminal process or custom execution failed. + * - `undefined`: the user forcibly closed the terminal or a custom execution exited + * without providing an exit code. + */ + readonly code: number | undefined; + } + /** * A location in the editor at which progress information can be shown. It depends on the * location how progress is visually represented. diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index f62ac3337db..7dd8193e7d5 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1025,38 +1025,6 @@ declare module 'vscode' { //#endregion - //#region Terminal exit status https://github.com/microsoft/vscode/issues/62103 - - export interface TerminalExitStatus { - /** - * The exit code that a terminal exited with, it can have the following values: - * - Zero: the terminal process or custom execution succeeded. - * - Non-zero: the terminal process or custom execution failed. - * - `undefined`: the user forcibly closed the terminal or a custom execution exited - * without providing an exit code. - */ - readonly code: number | undefined; - } - - export interface Terminal { - /** - * 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. - * ```typescript - * window.onDidCloseTerminal(t => { - * if (t.exitStatus && t.exitStatus.code) { - * vscode.window.showInformationMessage(`Exit code: ${t.exitStatus.code}`); - * } - * }); - * ``` - */ - readonly exitStatus: TerminalExitStatus | undefined; - } - - //#endregion - //#region Terminal dimensions property and change event https://github.com/microsoft/vscode/issues/55718 /** -- GitLab