-
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: query stdout terminal size to see if the output gose to a tty. #438
Commits on Sep 28, 2023
-
fix: query stdout terminal size to see if the output gose to a tty.
`terminal_size::terminal_size()` is used to determine if stdout is connected to a real tty/pty. In previous version of `terminal-size`, this method only queries the terminal size for `stdout`. However, it is changed in the following commit eminence/terminal-size@08f0e73 Now the method will use `stdout, stdin, stderr`, trying its best to determine the terminal size. This cannot be used to determine if `eza` output is piped or redirected. We should use `terminal_size_using_fd` on `stdout.as_raw_fd` instead. Resolves eza-community#434 Fixes eza-community#433
Configuration menu - View commit details
-
Copy full SHA for 427f975 - Browse repository at this point
Copy the full SHA 427f975View commit details -
fix: use windows-specific API for terminal size query on windows
The previous commit 427f975 uses `terminal_size::terminal_size_using_fd` and `io::stdout().as_raw_fd()` which are only available on unix platform, creating compatibility issue for windows. In this commit, I leverage rust conditional compilation and `terminal_size::terminal_size_using_handle` to implement the same functionality for windows platform.
Configuration menu - View commit details
-
Copy full SHA for 439e244 - Browse repository at this point
Copy the full SHA 439e244View commit details -
fix(cargo): add
windows-sys
dependency for targeting windowsWe use functions in this crate to get stdout handler for terminal size query.
Configuration menu - View commit details
-
Copy full SHA for ddd6850 - Browse repository at this point
Copy the full SHA ddd6850View commit details -
Configuration menu - View commit details
-
Copy full SHA for cf45b3e - Browse repository at this point
Copy the full SHA cf45b3eView commit details
Commits on Sep 29, 2023
-
fix: use
std::io::IsTerminal
to eliminate compatibility issuePrevisouly we tried to use `terminal_size_using_fd` on unix, and `terminal_size_using_handle` on windows to detect if stdout is connected to a terminal. This can be done by using `std::io::IsTerminal` on `std::io::stdout`, eliminating the need of conditional compiling.
Configuration menu - View commit details
-
Copy full SHA for c7aaecc - Browse repository at this point
Copy the full SHA c7aaeccView commit details -
fix(output): terminal size query should only check
stdout
Another API misuse. `terminal_size::terminal_size()` now looks into `stdout`, `stderr` and `stdin` to determine the terminal size with best effort. This is desirable for TUI applications, but not for CLI applications. `eza` only cares about the size of the terminal which is connected to standard output. We change this to `terminal_size_with_fd(stdout.as_raw_fd)` on unix, and `terminal_size_with_handle(STD_OUTPUT_HANDLE)` on windows.
Configuration menu - View commit details
-
Copy full SHA for 9d834fb - Browse repository at this point
Copy the full SHA 9d834fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for c28e5b7 - Browse repository at this point
Copy the full SHA c28e5b7View commit details
Commits on Oct 1, 2023
-
docs(README): change
color
tocolo[u]r
in the option description.`eza` manpage and `README` have been refering to this option as `--colo[u]r`. We should follow the tradition and keep the writing style consistent. Co-authored-by: MartinFillon <[email protected]> Signed-off-by: hehelego <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2d58129 - Browse repository at this point
Copy the full SHA 2d58129View commit details