From 56bb9e92cb1b86a2bea8697687c5e991e90926ec Mon Sep 17 00:00:00 2001 From: nibon7 Date: Thu, 15 Sep 2022 18:34:47 +0800 Subject: [PATCH] Use stripped path for lscolors to get style (#6561) --- crates/nu-command/src/viewers/table.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/nu-command/src/viewers/table.rs b/crates/nu-command/src/viewers/table.rs index a9575a4dd..656e9121f 100644 --- a/crates/nu-command/src/viewers/table.rs +++ b/crates/nu-command/src/viewers/table.rs @@ -591,10 +591,10 @@ fn render_path_name( let (style, has_metadata) = match std::fs::symlink_metadata(&stripped_path) { Ok(metadata) => ( - ls_colors.style_for_path_with_metadata(path, Some(&metadata)), + ls_colors.style_for_path_with_metadata(&stripped_path, Some(&metadata)), true, ), - Err(_) => (ls_colors.style_for_path(path), false), + Err(_) => (ls_colors.style_for_path(&stripped_path), false), }; // clickable links don't work in remote SSH sessions