Merge branch 'main' into ai-refactoring

This commit is contained in:
Nathan Sobo 2023-08-29 10:17:01 -06:00
commit 84b9c22170
4 changed files with 149 additions and 58 deletions

View file

@ -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> {