[wasi] Update time & instant crates (#2645)

* [wasi] Update time & instant crates

In https://github.com/nushell/nushell/pull/2643 instant was updated by adding it as a hard dependency in Cargo.toml, but it's better to avoid it and only update in Cargo.lock via `cargo update -p ...`.

Additionally, updated `time` crate so that now some basic commands like `ls` work too, although formatting is pretty bad.

* Update default terminal width to 80

If termsize can't return anything, use 80 chars (e.g. on WASI).
This commit is contained in:
Ingvar Stepanyan
2020-10-07 03:26:16 +01:00
committed by GitHub
parent 54326869e4
commit ff236da72c
4 changed files with 13 additions and 9 deletions

View File

@ -126,9 +126,8 @@ impl Host for BasicHost {
}
fn width(&self) -> usize {
let (mut term_width, _) = term_size::dimensions().unwrap_or_else(|| (20, 20));
term_width -= 1;
std::cmp::max(term_width, 20)
let (term_width, _) = term_size::dimensions().unwrap_or_else(|| (80, 20));
term_width
}
}