提交 9a797acc 编写于 作者: B bpceee

add option to disable terminal exit alert

上级 114adf70
......@@ -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
},
}
});
......
......@@ -37,6 +37,7 @@ import { ansiColorIdentifiers, TERMINAL_BACKGROUND_COLOR, TERMINAL_FOREGROUND_CO
import { PANEL_BACKGROUND } from 'vs/workbench/common/theme';
import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver';
import { IWorkspaceContextService, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
/** The amount of time to consider terminal errors to be related to the launch */
const LAUNCHING_DURATION = 500;
......@@ -125,7 +126,8 @@ export class TerminalInstance implements ITerminalInstance {
@IHistoryService private _historyService: IHistoryService,
@IThemeService private _themeService: IThemeService,
@IConfigurationResolverService private _configurationResolverService: IConfigurationResolverService,
@IWorkspaceContextService private _workspaceContextService: IWorkspaceContextService
@IWorkspaceContextService private _workspaceContextService: IWorkspaceContextService,
@IConfigurationService private configurationService: IConfigurationService,
) {
this._instanceDisposables = [];
this._processDisposables = [];
......@@ -687,7 +689,8 @@ export class TerminalInstance implements ITerminalInstance {
this._isExiting = true;
this._process = null;
let exitCodeMessage: string;
if (exitCode) {
if (exitCode && this.configurationService.getValue('terminal.integrated.showExitAlert')) {
exitCodeMessage = nls.localize('terminal.integrated.exitedWithCode', 'The terminal process terminated with exit code: {0}', exitCode);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册