Skip to content

Commit ae81753

Browse files
committed
Fix PowerShellProcess.dipose() to fire the onExited event
It was only firing when the terminal was closed, not whenever the process exited (which didn't make sense given its name and how we were using it).
1 parent 2397932 commit ae81753

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/process.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export class PowerShellProcess {
146146

147147
public dispose(): void {
148148
this.logger.writeVerbose(`Disposing PowerShell process with PID: ${this.pid}`);
149-
149+
this.onExitedEmitter.fire();
150150
void this.deleteSessionFile(this.sessionFilePath);
151151

152152
this.consoleTerminal?.dispose();
@@ -230,7 +230,6 @@ export class PowerShellProcess {
230230
}
231231

232232
this.logger.writeWarning(`PowerShell process terminated or Extension Terminal was closed, PID: ${this.pid}`);
233-
this.onExitedEmitter.fire();
234233
this.dispose();
235234
}
236235
}

src/session.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -530,13 +530,13 @@ export class SessionManager implements Middleware {
530530
this.sessionSettings);
531531

532532
languageServerProcess.onExited(
533-
async () => {
533+
() => {
534534
LanguageClientConsumer.onLanguageClientExited();
535535

536536
if (this.sessionStatus === SessionStatus.Running
537537
|| this.sessionStatus === SessionStatus.Busy) {
538538
this.setSessionStatus("Session Exited!", SessionStatus.Failed);
539-
await this.promptForRestart();
539+
void this.promptForRestart();
540540
}
541541
});
542542

0 commit comments

Comments
 (0)