diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/fs/30_fs.js | 11 | ||||
-rw-r--r-- | ext/io/12_io.js | 4 |
2 files changed, 13 insertions, 2 deletions
diff --git a/ext/fs/30_fs.js b/ext/fs/30_fs.js index 46358c42a..2efb0a878 100644 --- a/ext/fs/30_fs.js +++ b/ext/fs/30_fs.js @@ -72,6 +72,8 @@ import { op_fs_utime_sync, op_fs_write_file_async, op_fs_write_file_sync, + op_is_terminal, + op_set_raw, } from "ext:core/ops"; const { ArrayPrototypeFilter, @@ -766,6 +768,15 @@ class FsFile { futimeSync(this.#rid, atime, mtime); } + isTerminal() { + return op_is_terminal(this.#rid); + } + + setRaw(mode, options = {}) { + const cbreak = !!(options.cbreak ?? false); + op_set_raw(this.#rid, mode, cbreak); + } + lockSync(exclusive = false) { op_fs_flock_sync(this.#rid, exclusive); } diff --git a/ext/io/12_io.js b/ext/io/12_io.js index 70b639d45..fbaf28de7 100644 --- a/ext/io/12_io.js +++ b/ext/io/12_io.js @@ -5,7 +5,7 @@ // Thank you! We love Go! <3 import { core, internals, primordials } from "ext:core/mod.js"; -import { op_is_terminal, op_stdin_set_raw } from "ext:core/ops"; +import { op_is_terminal, op_set_raw } from "ext:core/ops"; const { Uint8Array, ArrayPrototypePush, @@ -218,7 +218,7 @@ class Stdin { setRaw(mode, options = {}) { const cbreak = !!(options.cbreak ?? false); - op_stdin_set_raw(mode, cbreak); + op_set_raw(this.#rid, mode, cbreak); } isTerminal() { |