Use stripped path for lscolors to get style (#6561)

This commit is contained in:
nibon7 2022-09-15 18:34:47 +08:00 committed by GitHub
parent 2791251268
commit 56bb9e92cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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