Skip to content

Commit

Permalink
Add workaround for io_uring bug on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell committed Feb 17, 2024
1 parent aa96f48 commit 400e96a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions run-pty.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

"use strict";

// Workaround for:
// https://github.com/lydell/run-pty/issues/45
// https://github.com/lydell/run-pty/issues/53
if (process.platform === "linux" && !("UV_USE_IO_URING" in process.env)) {
require("child_process")
.spawn(process.execPath, [__filename, ...process.argv.slice(2)], {
stdio: "inherit",
env: { UV_USE_IO_URING: "0", ...process.env },
})
// eslint-disable-next-line @typescript-eslint/unbound-method
.on("exit", process.exit);
// @ts-expect-error This is a deliberate exit.
return;
}

const fs = require("fs");
const path = require("path");
const os = require("os");
Expand Down

0 comments on commit 400e96a

Please sign in to comment.