Use symlink target for stat styling & icons#1644
Conversation
Support LS_COLORS/dircolors use of "target" for symlinks to select icons and styles for them according to the target stat. This mainly applies to directories - file name-based styles will still be based on the name of the link, not its target. This mirrors `ls` behavior.
joelim-work
left a comment
There was a problem hiding this comment.
Thanks for your pull request.
Originally the logic for applying styles was designed to be simple. However, I think supporting a special value of target for links is a good idea since it mirrors the behavior of ls, even if it makes the logic more complex. I will leave this up to @gokcehan to decide if such a feature can be included.
I have left a few comments in the meantime, these apply for both colors and icons.
|
@joelim-work Addressed your comments. I appreciate the feedback! I left changes in individual commits for now for review. Can squash on demand. |
There was a problem hiding this comment.
Thanks for the changes. I will give my approval for now, but also leave the PR open for a while just in case anyone else is interested in reviewing.
Edit: It looks like the CI build fails because of some minor incorrect formatting, please fix this.
Support LS_COLORS/dircolors use of "target" for symlinks to select icons and styles for them according to the target stat. This mainly applies to directories - file name-based styles will still be based on the name of the link, not its target. This mirrors
lsbehavior.This is an attempt to address issue #566 . I am by no means an experienced Go programmer, so please do give any feedback you have.
Fixes #566