aboutsummaryrefslogtreecommitdiff
path: root/src/js/node/tty.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/node/tty.js')
-rw-r--r--src/js/node/tty.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/js/node/tty.js b/src/js/node/tty.js
index 09010e8fc..d5645c6da 100644
--- a/src/js/node/tty.js
+++ b/src/js/node/tty.js
@@ -4,7 +4,9 @@ function ReadStream(fd) {
if (!(this instanceof ReadStream)) return new ReadStream(fd);
if (fd >> 0 !== fd || fd < 0) throw new RangeError("fd must be a positive integer");
- const stream = require("node:fs").ReadStream.call(this, `/dev/fd/${fd}`);
+ const stream = require("node:fs").ReadStream.call(this, "", {
+ fd,
+ });
stream.isRaw = false;
stream.isTTY = isatty(stream.fd);
@@ -93,7 +95,9 @@ function WriteStream(fd) {
if (!(this instanceof WriteStream)) return new WriteStream(fd);
if (fd >> 0 !== fd || fd < 0) throw new RangeError("fd must be a positive integer");
- const stream = require("node:fs").WriteStream.call(this, `/dev/fd/${fd}`);
+ const stream = require("node:fs").WriteStream.call(this, "", {
+ fd,
+ });
stream.columns = undefined;
stream.rows = undefined;