atty
atty copied to clipboard
are you or are you not a tty?
This helps to avoid false positives from file paths that just so happen to include the magic strings. It's done by detecting if the file is actually a pipe and...
Found while working on a wasm64-wasi runtime
The `winapi` crate has not been updated in two years. The replacement is `windows-sys`. Testing: compiled with old `rustc` (1.39.0) Build performance: compilation time improved from `4.2 sec` to `3.1...
Supports [the SOLID targets](https://doc.rust-lang.org/1.61.0/rustc/platform-support/kmc-solid.html) (`*-kmc-solid_*`) just by returning `false` similarly to the SGX and `wasm32` targets.
Fixes #50 as the problem was confirmed by a user on the community discord. I'm reasonably confident there aren't any problems with the new code, but it's always a good...
I have a program that reads from `stdin` only when isatty returns false let input_stdin = !atty::is(atty::Stream::Stdin); When running this from a cron it always returns `true` like if there...
https://github.com/softprops/atty/blob/7b5df17888997d57c2c1c8f91da1db5691f49953/src/lib.rs#L131 By replacing this vector with an array, we can remove the std dependency. The allocation is only 524 bytes long, and it wouldn't be unreasonable to allocate it on...
https://github.com/softprops/atty/blob/7b5df17888997d57c2c1c8f91da1db5691f49953/src/lib.rs#L131-L141 As far as I can tell, the pointer deference on line 141 in unsound, as there is no guarantee the vector will be properly aligned for `FILE_NAME_INFO` (which has...
_Dependabot Preview will be shut down on August 3rd, 2021. In order to keep getting Dependabot updates, please merge this PR and migrate to GitHub-native Dependabot before then._ Dependabot has...
My attempt at implementing #20 Python I/O objects usually have a `isatty()` method: ```python file = open("foo.txt", "wb") ret = file.isatty() ``` This PR mirrors that functionality by adding a...