- Fixed a bug where the current session stored in the shell instance wasnt getting updated after each state change

This commit is contained in:
2026-11-20 15:14:47 +01:00
parent 9a31a5985b
commit 57773fc2ef
+3
View File
@@ -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;
}