diff options
Diffstat (limited to 'cli/rt/40_tty.js')
-rw-r--r-- | cli/rt/40_tty.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cli/rt/40_tty.js b/cli/rt/40_tty.js new file mode 100644 index 000000000..3bab4f321 --- /dev/null +++ b/cli/rt/40_tty.js @@ -0,0 +1,23 @@ +// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. + +((window) => { + const { sendSync } = window.__bootstrap.dispatchJson; + + function consoleSize(rid) { + return sendSync("op_console_size", { rid }); + } + + function isatty(rid) { + return sendSync("op_isatty", { rid }); + } + + function setRaw(rid, mode) { + sendSync("op_set_raw", { rid, mode }); + } + + window.__bootstrap.tty = { + consoleSize, + isatty, + setRaw, + }; +})(this); |