diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-01-24 10:01:56 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-24 00:01:56 +0100 |
commit | 4eedac3604dad9f366d28868077eb02eddc22661 (patch) | |
tree | dda70cd31e731aad73e986002ef30acb84692dc4 /runtime/ops/tty.rs | |
parent | 60688c563e6d02813b021ad91132fe1eb3f103b6 (diff) |
feat: `Deno.{stdin,stdout,stderr}.isTerminal()`, deprecate `Deno.isatty()` (#22011)
This change:
1. Implements `Deno.stdin.isTerminal()`, `Deno.stdout.isTerminal()` and
`Deno.stderr.isTerminal()`.
2. Deprecates `Deno.isatty()` for removal in Deno v2, in favour of the
above instance methods.
3. Replaces use of `Deno.isatty()` with the above instance methods.
Related #21995
---------
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'runtime/ops/tty.rs')
-rw-r--r-- | runtime/ops/tty.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/ops/tty.rs b/runtime/ops/tty.rs index 6cc129883..40aa28494 100644 --- a/runtime/ops/tty.rs +++ b/runtime/ops/tty.rs @@ -52,7 +52,7 @@ deno_core::extension!( deno_tty, ops = [ op_stdin_set_raw, - op_isatty, + op_is_terminal, op_console_size, op_read_line_prompt ], @@ -210,7 +210,7 @@ fn op_stdin_set_raw( } #[op2(fast)] -fn op_isatty(state: &mut OpState, rid: u32) -> Result<bool, AnyError> { +fn op_is_terminal(state: &mut OpState, rid: u32) -> Result<bool, AnyError> { let handle = state.resource_table.get_handle(rid)?; Ok(handle.is_terminal()) } |