Skip to content

Commit 7ad78e6

Browse files
committed
Only show error in tasks when exit code is non-zero
1 parent d8a2d48 commit 7ad78e6

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/vs/workbench/contrib/terminal/browser/terminalInstance.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,11 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
966966
// Create exit code message
967967
switch (typeof exitCodeOrError) {
968968
case 'number':
969+
// Only show the error if the exit code is non-zero
969970
this._exitCode = exitCodeOrError;
971+
if (this._exitCode === 0) {
972+
break;
973+
}
970974

971975
let commandLine: string | undefined = undefined;
972976
if (this._shellLaunchConfig.executable) {

src/vs/workbench/contrib/terminal/node/terminalProcess.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
7878
const results = await Promise.all([this._validateCwd(), this._validateExecutable()]);
7979
const firstError = results.find(r => r !== undefined);
8080
if (firstError) {
81-
// TODO: Anything else we need to do here?
81+
// TODO: Anything else we need to do here to tear down the terminal instance?
8282
// this._processStartupComplete = Promise.resolve(undefined);
8383
// this._onProcessExit.fire(0);
8484

@@ -89,10 +89,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
8989
this.setupPtyProcess(this._shellLaunchConfig, this._ptyOptions);
9090
return undefined;
9191
} catch (err) {
92-
93-
// TODO: Anything else we need to do here?
94-
95-
// TODO: Extract code and message from the native exception, currently they're combined
92+
// TODO: Anything else we need to do here to tear down the terminal instance?
9693
// A native exception occurred
9794
this._logService.trace('IPty#spawn native exception', err);
9895
return { message: `A native exception occurred during launch (${err.message})` };

0 commit comments

Comments
 (0)