From 4b76aa9ae434c24494dd7823a55a9db22bb4fbaf Mon Sep 17 00:00:00 2001 From: goth-turtle <93494392+goth-turtle@users.noreply.github.com> Date: Mon, 1 Nov 2021 00:26:56 +0100 Subject: [PATCH 1/2] Don't assume connection to a tty when number of columns is set --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 67309931..631b98cb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -66,7 +66,7 @@ fn main() { let writer = io::stdout(); let console_width = options.view.width.actual_terminal_width(); - let theme = options.theme.to_theme(console_width.is_some()); + let theme = options.theme.to_theme(unsafe {libc::isatty(1)} != 0); let exa = Exa { options, writer, input_paths, theme, console_width, git }; match exa.run() { From 3627633148f56caef18075fb698a26c7a68972f2 Mon Sep 17 00:00:00 2001 From: goth-turtle <93494392+goth-turtle@users.noreply.github.com> Date: Thu, 4 Nov 2021 23:18:02 +0100 Subject: [PATCH 2/2] Use terminal_size::terminal_size() instead of libc::isatty() --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 631b98cb..5fcb8332 100644 --- a/src/main.rs +++ b/src/main.rs @@ -66,7 +66,7 @@ fn main() { let writer = io::stdout(); let console_width = options.view.width.actual_terminal_width(); - let theme = options.theme.to_theme(unsafe {libc::isatty(1)} != 0); + let theme = options.theme.to_theme(terminal_size::terminal_size().is_some()); let exa = Exa { options, writer, input_paths, theme, console_width, git }; match exa.run() {