Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to disable terminal exit alert #40861

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/vs/workbench/parts/terminal/common/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export interface ITerminalConfiguration {
osx: { [key: string]: string };
windows: { [key: string]: string };
};
showExitAlert: boolean;
}

export interface ITerminalConfigHelper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,12 @@ configurationRegistry.registerConfiguration({
'description': nls.localize('terminal.integrated.env.windows', "Object with environment variables that will be added to the VS Code process to be used by the terminal on Windows"),
'type': 'object',
'default': {}
}
},
'terminal.integrated.showExitAlert': {
'description': nls.localize('terminal.integrated.showExitAlert', "Show alert `The terminal process terminated with exit code` when exit code is non-zero."),
'type': 'boolean',
'default': true
},
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ export class TerminalInstance implements ITerminalInstance {
this._isExiting = true;
this._process = null;
let exitCodeMessage: string;

if (exitCode) {
exitCodeMessage = nls.localize('terminal.integrated.exitedWithCode', 'The terminal process terminated with exit code: {0}', exitCode);
}
Expand Down Expand Up @@ -744,7 +745,9 @@ export class TerminalInstance implements ITerminalInstance {
}
this._messageService.show(Severity.Error, nls.localize('terminal.integrated.launchFailed', 'The terminal process command `{0}{1}` failed to launch (exit code: {2})', this._shellLaunchConfig.executable, args, exitCode));
} else {
this._messageService.show(Severity.Error, exitCodeMessage);
if (this._configHelper.config.showExitAlert) {
this._messageService.show(Severity.Error, exitCodeMessage);
}
}
}
}
Expand Down