0

Essentially this question, but for Rust: How do I detect whether sys.stdout is attached to terminal or not?

I didn't see anything in the Stdout docs (https://doc.rust-lang.org/std/io/struct.Stdout.html)

brundolf
  • 1,170
  • 1
  • 9
  • 18
  • Ah yes, I didn't find it because it's asking the inverse question. Pretty disappointing that it requires either FFI or a third-party crate, but if that's still the case then this does answer my question. – brundolf Oct 29 '20 at 20:38
  • I mean, there's no cross platform notion of what a TTY is, so putting it in `std` would likely have adverse effects on portability. – trent Oct 29 '20 at 20:46

0 Answers0