- Fixed a bug where the current session stored in the shell instance wasnt getting updated after each state change
This commit is contained in:
@@ -33,6 +33,7 @@ export class Shell {
|
||||
this._ProcessManager.on("process", payload => this._EventEmitter.emit("process", payload));
|
||||
this._ProcessManager.on("result", payload => {
|
||||
this._State = payload.state;
|
||||
this._Session = this._State.sessionStack[this._State.sessionStack.length - 1]!;
|
||||
this._State = withExitCode(
|
||||
this._State,
|
||||
payload.result.type === "success" ? payload.result.exitCode : payload.result.error.exitCode,
|
||||
@@ -64,6 +65,7 @@ export class Shell {
|
||||
);
|
||||
|
||||
this._State = withExitCode(this._State, result.error.exitCode);
|
||||
this._Session = this._State.sessionStack[this._State.sessionStack.length - 1]!;
|
||||
this._EventEmitter.emit("result", { pid: 0, result, state: this._State });
|
||||
return;
|
||||
}
|
||||
@@ -77,6 +79,7 @@ export class Shell {
|
||||
);
|
||||
|
||||
this._State = withExitCode(this._State, result.error.exitCode);
|
||||
this._Session = this._State.sessionStack[this._State.sessionStack.length - 1]!;
|
||||
this._EventEmitter.emit("result", { pid: 0, result, state: this._State });
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user