Skip to content

Commit

Permalink
Fix uv shell never exits (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
webfiltered authored Dec 28, 2024
1 parent 94216bf commit 8426150
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/virtualEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,8 @@ export class VirtualEnvironment {
try {
await this.createEnvironment(callbacks);
} finally {
if (this.uvPty) {
// If we have a pty instance then we need to kill it on a delay
// else you may get an EPIPE error on reading the stream if it is
// reading/writing as you kill it
const pty = this.uvPty;
this.uvPty = undefined;
pty.pause();
setTimeout(() => {
this.uvPty?.kill();
}, 100);
}
const pid = this.uvPty?.pid;
if (pid) process.kill(pid);
}
}

Expand Down

0 comments on commit 8426150

Please sign in to comment.