mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 01:17:47 +02:00
Use is-terminal
crate for now (#9670)
# Description Until we bump our minimal Rust version to `1.70.0` we can't use `std::io::IsTerminal`. The crate `is-terminal` (depending on `rustix` or `windows-sys`) can provide the same. Get's rid of the dependency on the outdated `atty` crate. We already transitively depend on it (e.g. through `miette`) As soon as we reach the new Rust version we can supersede this with @nibon7's #9550 Co-authored-by: nibon7 <nibon7@163.com>
This commit is contained in:
committed by
GitHub
parent
026335fff0
commit
39b43d1e4b
@ -1,8 +1,9 @@
|
||||
#[cfg(unix)]
|
||||
pub(crate) fn acquire_terminal(interactive: bool) {
|
||||
use is_terminal::IsTerminal;
|
||||
use nix::sys::signal::{signal, SigHandler, Signal};
|
||||
|
||||
if !atty::is(atty::Stream::Stdin) {
|
||||
if !std::io::stdin().is_terminal() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user