mirror of
https://github.com/denoland/deno.git
synced 2024-11-22 04:51:22 +00:00
feat: Stabilize Deno.stdin.setRaw() (#16399)
This commit is contained in:
parent
dbcbf53ab5
commit
302590015d
@ -27,7 +27,6 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[
|
||||
"Location",
|
||||
"Metrics",
|
||||
"OpMetrics",
|
||||
"SetRawOptions",
|
||||
"SignalStream",
|
||||
"StartTlsOptions",
|
||||
"SystemMemoryInfo",
|
||||
|
18
cli/dts/lib.deno.ns.d.ts
vendored
18
cli/dts/lib.deno.ns.d.ts
vendored
@ -1883,10 +1883,14 @@ declare namespace Deno {
|
||||
*/
|
||||
export const File: typeof FsFile;
|
||||
|
||||
/** **UNSTABLE**: new API, yet to be vetted.
|
||||
*
|
||||
* @category I/O */
|
||||
/** @category I/O */
|
||||
export interface SetRawOptions {
|
||||
/**
|
||||
* The `cbreak` option can be used to indicate that characters that
|
||||
* correspond to a signal should still be generated. When disabling raw
|
||||
* mode, this option is ignored. This functionality currently only works on
|
||||
* Linux and Mac OS.
|
||||
*/
|
||||
cbreak: boolean;
|
||||
}
|
||||
|
||||
@ -1913,19 +1917,13 @@ declare namespace Deno {
|
||||
readonly rid: number;
|
||||
/** A readable stream interface to `stdin`. */
|
||||
readonly readable: ReadableStream<Uint8Array>;
|
||||
/** **UNSTABLE**: new API, yet to be vetted.
|
||||
*
|
||||
/**
|
||||
* Set TTY to be under raw mode or not. In raw mode, characters are read and
|
||||
* returned as is, without being processed. All special processing of
|
||||
* characters by the terminal is disabled, including echoing input
|
||||
* characters. Reading from a TTY device in raw mode is faster than reading
|
||||
* from a TTY device in canonical mode.
|
||||
*
|
||||
* The `cbreak` option can be used to indicate that characters that
|
||||
* correspond to a signal should still be generated. When disabling raw
|
||||
* mode, this option is ignored. This functionality currently only works on
|
||||
* Linux and Mac OS.
|
||||
*
|
||||
* ```ts
|
||||
* Deno.stdin.setRaw(true, { cbreak: true });
|
||||
* ```
|
||||
|
@ -3384,7 +3384,6 @@ async fn http2_request_url() {
|
||||
fn set_raw_should_not_panic_on_no_tty() {
|
||||
let output = util::deno_cmd()
|
||||
.arg("eval")
|
||||
.arg("--unstable")
|
||||
.arg("Deno.stdin.setRaw(true)")
|
||||
// stdin set to piped so it certainly does not refer to TTY
|
||||
.stdin(std::process::Stdio::piped())
|
||||
|
@ -53,8 +53,6 @@ fn op_stdin_set_raw(
|
||||
is_raw: bool,
|
||||
cbreak: bool,
|
||||
) -> Result<(), AnyError> {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user