提交 5a79a1ed 编写于 作者: G Gabriel DeBacker

Updates based on feedback

上级 d728d3dc
......@@ -299,27 +299,6 @@ export class TerminalTaskSystem implements ITaskSystem {
});
}
public extensionCallbackTaskEnded(task: Task): Promise<TaskTerminateResponse> {
let activeTerminal = this.activeTasks[task.getMapKey()];
if (!activeTerminal) {
return Promise.resolve<TaskTerminateResponse>({ success: false, task: undefined });
}
return new Promise<TaskTerminateResponse>((resolve, reject) => {
let terminal = activeTerminal.terminal;
const onDisposed = terminal.onDisposed(() => {
let task = activeTerminal.task;
try {
onDisposed.dispose();
this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.End, task));
} catch (error) {
// Do nothing.
}
resolve({ success: true, task: task });
});
terminal.dispose();
});
}
public terminateAll(): Promise<TaskTerminateResponse[]> {
let promises: Promise<TaskTerminateResponse>[] = [];
Object.keys(this.activeTasks).forEach((key) => {
......@@ -599,7 +578,11 @@ export class TerminalTaskSystem implements ITaskSystem {
this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.ProcessStarted, task, terminal!.processId!));
processStartedSignaled = true;
}
this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.ProcessEnded, task, exitCode));
if (task.command.runtime !== RuntimeType.CustomExecution) {
this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.ProcessEnded, task, exitCode));
}
for (let i = 0; i < eventCounter; i++) {
let event = TaskEvent.create(TaskEventKind.Inactive, task);
this._onDidStateChange.fire(event);
......@@ -671,7 +654,9 @@ export class TerminalTaskSystem implements ITaskSystem {
this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.ProcessStarted, task, terminal.processId!));
processStartedSignaled = true;
}
this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.ProcessEnded, task, exitCode));
if (task.command.runtime !== RuntimeType.CustomExecution) {
this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.ProcessEnded, task, exitCode));
}
this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.Inactive, task));
this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.End, task));
resolve({ exitCode });
......
......@@ -283,7 +283,7 @@ export class ProcessTaskSystem implements ITaskSystem {
this.childProcessEnded();
watchingProblemMatcher.done();
watchingProblemMatcher.dispose();
if (processStartedSignaled) {
if (processStartedSignaled && task.command.runtime !== RuntimeType.CustomExecution) {
this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.ProcessEnded, task, success.cmdCode!));
}
toDispose = dispose(toDispose!);
......@@ -339,7 +339,7 @@ export class ProcessTaskSystem implements ITaskSystem {
startStopProblemMatcher.done();
startStopProblemMatcher.dispose();
this.checkTerminated(task, success);
if (processStartedSignaled) {
if (processStartedSignaled && task.command.runtime !== RuntimeType.CustomExecution) {
this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.ProcessEnded, task, success.cmdCode!));
}
this._onDidStateChange.fire(inactiveEvent);
......
......@@ -740,10 +740,10 @@ export class TerminalInstance implements ITerminalInstance {
if (this._processManager) {
this._processManager.dispose(immediate);
} else {
// In cases where there is no associated process (for example executing an exetnsion callback task)
// consumers still expect on onExit event to be fired. An example of this is terminating the extnesion callback
// task.
this._onExit.fire(this._id);
// In cases where there is no associated process (for example executing an extension callback task)
// consumers still expect on onExit event to be fired. An example of this is terminating the extension callback
// task. There is no exit code at this point, so firing undefined is appropriate.
this._onExit.fire(undefined);
}
if (!this._isDisposed) {
......@@ -1094,8 +1094,8 @@ export class TerminalInstance implements ITerminalInstance {
// Set the new shell launch config
this._shellLaunchConfig = shell; // Must be done before calling _createProcess()
// Initialize new process if we have one.
if (this._shellLaunchConfig.executable) {
// Launch the process unless this is only a renderer.
if (!this._shellLaunchConfig.isRendererOnly) {
this._createProcess();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册