From c7276e15e54b43aa6649ca149d92811059c6415f Mon Sep 17 00:00:00 2001 From: Marcus Hultman Date: Mon, 30 Nov 2020 10:08:03 -0600 Subject: feat(unstable): add cbreak option to setRaw (#8383) --- cli/dts/lib.deno.unstable.d.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'cli/dts') diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 667b1fbba..d8e226699 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -815,6 +815,10 @@ declare namespace Deno { windowChange: () => SignalStream; }; + export type SetRawOptions = { + cbreak: boolean; + }; + /** **UNSTABLE**: new API, yet to be vetted * * Set TTY to be under raw mode or not. In raw mode, characters are read and @@ -823,11 +827,19 @@ declare namespace Deno { * 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.setRaw(myTTY.rid, true); + * Deno.setRaw(myTTY.rid, true, { cbreak: true }); * ``` */ - export function setRaw(rid: number, mode: boolean): void; + export function setRaw( + rid: number, + mode: boolean, + options?: SetRawOptions, + ): void; /** **UNSTABLE**: needs investigation into high precision time. * -- cgit v1.2.3