提交 a500e32b 编写于 作者: D Daniel Imms

Fix crash when killing waitOnExit terminal instances

Fixes #18520
上级 cb1f735a
......@@ -381,7 +381,11 @@ export class TerminalInstance implements ITerminalInstance {
exitCodeMessage = nls.localize('terminal.integrated.exitedWithCode', 'The terminal process terminated with exit code: {0}', exitCode);
}
if (this._shellLaunchConfig.waitOnExit) {
// Only trigger wait on exit when the exit was triggered by the process, not through the
// `workbench.action.terminal.kill` command
const triggeredByProcess = exitCode !== null;
if (triggeredByProcess && this._shellLaunchConfig.waitOnExit) {
if (exitCode) {
this._xterm.writeln(exitCodeMessage);
}
......
......@@ -62,6 +62,7 @@ export class TerminalService implements ITerminalService {
}
public createInstance(shell: IShellLaunchConfig = {}): ITerminalInstance {
shell.waitOnExit = true;
let terminalInstance = this._instantiationService.createInstance(TerminalInstance,
this._terminalFocusContextKey,
this._configHelper,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册