mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-24 15:42:53 +00:00
chore: Use IsTerminal trait instead of relying on libc to detect stdout being a terminal (#2908)
IsTerminal was added in 1.70. Release Notes: - N/A
This commit is contained in:
parent
396558755e
commit
ea0e5e880e
1 changed files with 2 additions and 3 deletions
|
@ -31,7 +31,7 @@ use std::{
|
|||
env,
|
||||
ffi::OsStr,
|
||||
fs::OpenOptions,
|
||||
io::Write as _,
|
||||
io::{IsTerminal, Write as _},
|
||||
os::unix::prelude::OsStrExt,
|
||||
panic,
|
||||
path::{Path, PathBuf},
|
||||
|
@ -635,8 +635,7 @@ async fn load_login_shell_environment() -> Result<()> {
|
|||
}
|
||||
|
||||
fn stdout_is_a_pty() -> bool {
|
||||
std::env::var(FORCE_CLI_MODE_ENV_VAR_NAME).ok().is_none()
|
||||
&& unsafe { libc::isatty(libc::STDOUT_FILENO as i32) != 0 }
|
||||
std::env::var(FORCE_CLI_MODE_ENV_VAR_NAME).ok().is_none() && std::io::stdout().is_terminal()
|
||||
}
|
||||
|
||||
fn collect_path_args() -> Vec<PathBuf> {
|
||||
|
|
Loading…
Reference in a new issue