From 405ae0403e9683fc6493faa73f5d3fb891da4bd0 Mon Sep 17 00:00:00 2001 From: Varun Chawla Date: Fri, 13 Feb 2026 00:58:10 -0800 Subject: [PATCH 1/4] fix: --level not working when a path argument is specified Fixes eza-community/eza#1701 --- src/main.rs | 14 +++------ tests/cmd/recurse_level_with_path_unix.stderr | 0 tests/cmd/recurse_level_with_path_unix.stdout | 31 +++++++++++++++++++ tests/cmd/recurse_level_with_path_unix.toml | 2 ++ 4 files changed, 38 insertions(+), 9 deletions(-) create mode 100644 tests/cmd/recurse_level_with_path_unix.stderr create mode 100644 tests/cmd/recurse_level_with_path_unix.stdout create mode 100644 tests/cmd/recurse_level_with_path_unix.toml diff --git a/src/main.rs b/src/main.rs index 7b2ac3701..5f085878d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -266,7 +266,7 @@ impl Exa<'_> { self.options.filter.filter_argument_files(&mut files); self.print_files(None, files)?; - self.print_dirs(dirs, no_files, is_only_dir, exit_status) + self.print_dirs(dirs, no_files, is_only_dir, exit_status, 0) } fn print_dirs( @@ -275,6 +275,7 @@ impl Exa<'_> { mut first: bool, is_only_dir: bool, exit_status: i32, + depth: usize, ) -> io::Result { let View { file_style: file_name::Options { quote_style, .. }, @@ -340,14 +341,9 @@ impl Exa<'_> { self.options.filter.sort_files(&mut children); if let Some(recurse_opts) = self.options.dir_action.recurse_options() { - let depth = dir - .path - .components() - .filter(|&c| c != Component::CurDir) - .count() - + 1; + let child_depth = depth + 1; let follow_links = self.options.view.follow_links; - if !recurse_opts.tree && !recurse_opts.is_too_deep(depth) { + if !recurse_opts.tree && !recurse_opts.is_too_deep(child_depth) { let child_dirs = children .iter() .filter(|f| { @@ -361,7 +357,7 @@ impl Exa<'_> { .collect::>(); self.print_files(Some(dir), children)?; - match self.print_dirs(child_dirs, false, false, exit_status) { + match self.print_dirs(child_dirs, false, false, exit_status, child_depth) { Ok(_) => (), Err(e) => return Err(e), } diff --git a/tests/cmd/recurse_level_with_path_unix.stderr b/tests/cmd/recurse_level_with_path_unix.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/recurse_level_with_path_unix.stdout b/tests/cmd/recurse_level_with_path_unix.stdout new file mode 100644 index 000000000..d954b4624 --- /dev/null +++ b/tests/cmd/recurse_level_with_path_unix.stdout @@ -0,0 +1,31 @@ +a +b +c +d +dir-symlink -> vagrant/debug +e +exa +f +g +h +i +image.jpg.img.c.rs.log.png +index.svg +j +k +l +m +n +o +p +q +vagrant + +tests/itest/exa: +file.c -> djihisudjuhfius +sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss + +tests/itest/vagrant: +debug +dev +log diff --git a/tests/cmd/recurse_level_with_path_unix.toml b/tests/cmd/recurse_level_with_path_unix.toml new file mode 100644 index 000000000..a95089c99 --- /dev/null +++ b/tests/cmd/recurse_level_with_path_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "-R --level=2 tests/itest" From 40cc531dc592dae571eecc8bb05ded0f8dc39faa Mon Sep 17 00:00:00 2001 From: Varun Chawla Date: Fri, 13 Feb 2026 22:57:22 -0800 Subject: [PATCH 2/4] fix(test): update long_recurse_with_level test to use --level 1 The test snapshot expected output was based on the old buggy behavior where --level was ignored with path arguments. Update to --level 1 to keep the snapshot manageable while the actual --level with path behavior is covered by recurse_level_with_path_unix test. --- tests/gen/long_recurse_with_level_unix.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/gen/long_recurse_with_level_unix.toml b/tests/gen/long_recurse_with_level_unix.toml index 602667c23..732b23d59 100644 --- a/tests/gen/long_recurse_with_level_unix.toml +++ b/tests/gen/long_recurse_with_level_unix.toml @@ -1,2 +1,2 @@ bin.name = "eza" -args = "tests/test_dir --long --no-user --no-permissions --no-time --no-filesize --recurse --level 2" +args = "tests/test_dir --long --no-user --no-permissions --no-time --no-filesize --recurse --level 1" From 543539160fe6008bdbe60a96692a30b816556d37 Mon Sep 17 00:00:00 2001 From: Varun Chawla Date: Mon, 23 Feb 2026 23:41:06 -0800 Subject: [PATCH 3/4] fix(ci): ignore RUSTSEC-2026-0009 advisory for time crate The time crate v0.3.47 fix requires Rust 1.88 (edition 2024) which is incompatible with the current MSRV of 1.83. The vulnerability is a stack overflow in format description parsing via plist, which is low risk for eza since the input is not user-controlled. --- deny.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deny.toml b/deny.toml index 68a7ee27d..aaabb1af3 100644 --- a/deny.toml +++ b/deny.toml @@ -72,7 +72,11 @@ yanked = "warn" # A list of advisory IDs to ignore. Note that ignored advisories will still # output a note when they are encountered. ignore = [ - #"RUSTSEC-0000-0000", + # time v0.3.44 stack overflow in format description parsing (via plist). + # Cannot upgrade to >=0.3.47 because it requires Rust 1.88 (edition 2024), + # which is above the current MSRV (1.83). Low risk for eza since time + # parsing input is not user-controlled. Will be resolved when MSRV is bumped. + "RUSTSEC-2026-0009", ] # Threshold for security vulnerabilities, any vulnerability with a CVSS score # lower than the range specified will be ignored. Note that ignored advisories From b4e09790454b284a00b14bc1087142752e6f6204 Mon Sep 17 00:00:00 2001 From: Varun Chawla Date: Wed, 11 Mar 2026 21:35:30 -0700 Subject: [PATCH 4/4] fix: remove unused Component import The depth calculation refactor removed the use of std::path::Component, but the import was left behind causing clippy to fail. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 5f085878d..2fef5c58f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,7 @@ use std::env; use std::ffi::{OsStr, OsString}; use std::io::{self, ErrorKind, IsTerminal, Read, Write, stdin}; -use std::path::{Component, PathBuf}; +use std::path::PathBuf; use std::process::exit; use nu_ansi_term::{AnsiStrings as ANSIStrings, Style};