diff --git a/Cargo.toml b/Cargo.toml index abc3f26b0..901578334 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -289,7 +289,6 @@ indicatif = "0.17" itertools = "0.12.0" libc = "0.2.150" lscolors = { version = "0.16.0", default-features = false, features = [ - "nu-ansi-term", "gnu_legacy", ] } memchr = "2" diff --git a/src/uu/ls/Cargo.toml b/src/uu/ls/Cargo.toml index 56b642a1a..a82a1f37e 100644 --- a/src/uu/ls/Cargo.toml +++ b/src/uu/ls/Cargo.toml @@ -22,7 +22,7 @@ number_prefix = { workspace = true } uutils_term_grid = { workspace = true } terminal_size = { workspace = true } glob = { workspace = true } -lscolors = { workspace = true, features = ["gnu_legacy"] } +lscolors = { workspace = true } uucore = { workspace = true, features = [ "entries", "fs", diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs index 4f56f2a0d..f5858dcea 100644 --- a/tests/by-util/test_ls.rs +++ b/tests/by-util/test_ls.rs @@ -1983,20 +1983,6 @@ fn test_ls_recursive_1() { .stdout_is(out); } -// Function to convert a string to its ASCII representation -fn to_ascii_representation(input: &str) -> String { - input - .chars() - .map(|c| { - if c.is_ascii_control() || !c.is_ascii() { - format!("\\x{:02x}", c as u32) - } else { - c.to_string() - } - }) - .collect::() -} - #[test] fn test_ls_color() { let scene = TestScenario::new(util_name!()); @@ -2058,8 +2044,8 @@ fn test_ls_color() { .succeeds(); let expected = format!("{} test-color\x0ab {}", a_with_colors, z_with_colors); assert_eq!( - to_ascii_representation(result.stdout_str()), - to_ascii_representation(&expected) + result.stdout_str().escape_default().to_string(), + expected.escape_default().to_string() ); assert_eq!(result.stdout_str(), expected); }