diff options
| author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-02-19 01:27:44 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-18 07:27:44 -0700 |
| commit | c1fac11dfaf9d656b7361708d9faab1916eac846 (patch) | |
| tree | 151c729aa2774c21924b0bb8a1c6aa6daffea854 /runtime | |
| parent | 7abd72a80f0aafe071ad7d298b48e0da741cc9f3 (diff) | |
feat(fs): `Deno.FsFile.{isTerminal,setRaw}()` (#22234)
Closes #22229.
---------
Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/js/40_tty.js | 2 | ||||
| -rw-r--r-- | runtime/ops/tty.rs | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/runtime/js/40_tty.js b/runtime/js/40_tty.js index 5b8bbc0be..dd364f18d 100644 --- a/runtime/js/40_tty.js +++ b/runtime/js/40_tty.js @@ -16,7 +16,7 @@ function isatty(rid) { internals.warnOnDeprecatedApi( "Deno.isatty()", new Error().stack, - "Use `Deno.stdin.isTerminal()`, `Deno.stdout.isTerminal()` or `Deno.stderr.isTerminal()` instead.", + "Use `Deno.stdin.isTerminal()`, `Deno.stdout.isTerminal()`, `Deno.stderr.isTerminal()` or `Deno.FsFile.isTerminal()` instead.", ); return op_is_terminal(rid); } diff --git a/runtime/ops/tty.rs b/runtime/ops/tty.rs index 40aa28494..e570754f2 100644 --- a/runtime/ops/tty.rs +++ b/runtime/ops/tty.rs @@ -51,7 +51,7 @@ use winapi::um::wincon; deno_core::extension!( deno_tty, ops = [ - op_stdin_set_raw, + op_set_raw, op_is_terminal, op_console_size, op_read_line_prompt @@ -83,12 +83,12 @@ fn mode_raw_input_off(original_mode: DWORD) -> DWORD { } #[op2(fast)] -fn op_stdin_set_raw( +fn op_set_raw( state: &mut OpState, + rid: u32, is_raw: bool, cbreak: bool, ) -> Result<(), AnyError> { - let rid = 0; // stdin is always rid=0 let handle_or_fd = state.resource_table.get_fd(rid)?; // From https://github.com/kkawakam/rustyline/blob/master/src/tty/windows.rs |
