File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -881,6 +881,11 @@ declare module 'vscode' {
881881 /**
882882 * An event that when fired will signal that the pty is closed and dispose of the terminal.
883883 *
884+ * A number can be used to provide an exit code for the terminal. Exit codes must be
885+ * positive and a non-zero exit codes signals failure which shows a notification for a
886+ * regular terminal and allows dependent tasks to proceed when used with the
887+ * `CustomExecution2` API.
888+ *
884889 * **Example:** Exit the terminal when "y" is pressed, otherwise show a notification.
885890 * ```typescript
886891 * const writeEmitter = new vscode.EventEmitter<string>();
@@ -899,7 +904,7 @@ declare module 'vscode' {
899904 * };
900905 * vscode.window.createTerminal({ name: 'Exit example', pty });
901906 */
902- onDidClose ?: Event < void > ;
907+ onDidClose ?: Event < void | number > ;
903908
904909 /**
905910 * Implement to handle when the pty is open and ready to start firing events.
Original file line number Diff line number Diff line change @@ -738,7 +738,7 @@ class ExtHostPseudoterminal implements ITerminalChildProcess {
738738 // Attach the listeners
739739 this . _pty . onDidWrite ( e => this . _onProcessData . fire ( e ) ) ;
740740 if ( this . _pty . onDidClose ) {
741- this . _pty . onDidClose ( e => this . _onProcessExit . fire ( 0 ) ) ;
741+ this . _pty . onDidClose ( e => this . _onProcessExit . fire ( e || 0 ) ) ;
742742 }
743743 if ( this . _pty . onDidOverrideDimensions ) {
744744 this . _pty . onDidOverrideDimensions ( e => this . _onProcessOverrideDimensions . fire ( e ? { cols : e . columns , rows : e . rows } : e ) ) ;
You can’t perform that action at this time.
0 commit comments