From 70bc0eb72b01249b4c1ccc92b51bf5c442b3edc9 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Wed, 28 Sep 2022 15:03:56 +0200 Subject: feat(unstable): Deno.setRaw -> Deno.stdin.setRaw (#15797) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek IwaƄczuk --- runtime/ops/tty.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'runtime/ops') diff --git a/runtime/ops/tty.rs b/runtime/ops/tty.rs index e267fc07f..07c636e99 100644 --- a/runtime/ops/tty.rs +++ b/runtime/ops/tty.rs @@ -40,7 +40,7 @@ fn get_windows_handle( pub fn init() -> Extension { Extension::builder() .ops(vec![ - op_set_raw::decl(), + op_stdin_set_raw::decl(), op_isatty::decl(), op_console_size::decl(), ]) @@ -48,13 +48,14 @@ pub fn init() -> Extension { } #[op(fast)] -fn op_set_raw( +fn op_stdin_set_raw( state: &mut OpState, - rid: u32, is_raw: bool, cbreak: bool, ) -> Result<(), AnyError> { - super::check_unstable(state, "Deno.setRaw"); + super::check_unstable(state, "Deno.stdin.setRaw"); + + let rid = 0; // stdin is always rid=0 // From https://github.com/kkawakam/rustyline/blob/master/src/tty/windows.rs // and https://github.com/kkawakam/rustyline/blob/master/src/tty/unix.rs -- cgit v1.2.3