diff --git a/crates/common/src/lib.rs b/crates/common/src/lib.rs index 084783db6..459c74423 100644 --- a/crates/common/src/lib.rs +++ b/crates/common/src/lib.rs @@ -133,6 +133,7 @@ pub struct UnescapeFlags: u32 { /// most common operating systems do not use them. The value is cached for the duration of the fish /// session. We err on the side of assuming it's not a console session. This approach isn't /// bullet-proof and that's OK. +#[cfg(not(any(target_os = "ios", target_os = "macos")))] pub fn is_console_session() -> bool { static IS_CONSOLE_SESSION: OnceLock = OnceLock::new(); // TODO(terminal-workaround) @@ -154,6 +155,12 @@ pub fn is_console_session() -> bool { }) } +#[cfg(any(target_os = "ios", target_os = "macos"))] +pub fn is_console_session() -> bool { + // No console session on Apple, and ttyname may hang (#12506). + false +} + /// Exits without invoking destructors (via _exit), useful for code after fork. pub fn exit_without_destructors(code: libc::c_int) -> ! { unsafe { libc::_exit(code) };