summaryrefslogtreecommitdiff
path: root/runtime/ops
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2022-09-28 15:03:56 +0200
committerGitHub <noreply@github.com>2022-09-28 15:03:56 +0200
commit70bc0eb72b01249b4c1ccc92b51bf5c442b3edc9 (patch)
treedbf7839f3db529e7d156426343a8a03963436967 /runtime/ops
parentfa9e7aab6d49f241a4eb30cc0e261f8ceb64af2f (diff)
feat(unstable): Deno.setRaw -> Deno.stdin.setRaw (#15797)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'runtime/ops')
-rw-r--r--runtime/ops/tty.rs9
1 files changed, 5 insertions, 4 deletions
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