Depending on whether a binary is run directly or with cargo run, isatty() seems to give different results. For example, given the following code:
fn main() {
let fileno = unsafe { libc::STDIN_FILENO as i32 };
let isatty = unsafe { libc::isatty(fileno) };
println!("fileno: {}, isatty: {}", fileno, isatty);
}
When run with cargo run, the output is
However, when the binary is directly run, the output is
I'm not sure if this is expected or not, or if it's fixable from Rust rather than from the C implementation, but I thought I was worth checking just in case.
EDIT: I'm realizing this is more like caused by something in Cargo than libc, so there's probably nothing that can be done from here.