diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-12-13 02:52:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-12 20:52:10 -0500 |
commit | 8c026dab92b20fea44bc66f84db48b885c7264d1 (patch) | |
tree | 884704fb4721c9e227859451e58f524ace0a2261 /cli/util/console.rs | |
parent | 4a17c930882c5765e5fdedb50b6493469f61e32d (diff) |
feat: improve download progress bar (#16984)
Co-authored-by: David Sherret <dsherret@gmail.com>
Diffstat (limited to 'cli/util/console.rs')
-rw-r--r-- | cli/util/console.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cli/util/console.rs b/cli/util/console.rs new file mode 100644 index 000000000..c36b274db --- /dev/null +++ b/cli/util/console.rs @@ -0,0 +1,7 @@ +use deno_runtime::ops::tty::ConsoleSize; + +/// Gets the console size. +pub fn console_size() -> Option<ConsoleSize> { + let stderr = &deno_runtime::ops::io::STDERR_HANDLE; + deno_runtime::ops::tty::console_size(stderr).ok() +} |