Skip to content

color of symbolic link and color + icon of link target #1010

Open
@thranduil79

Description

@thranduil79

hi,

i am using lsdeluxe for years now (thank you).

as an excercise, i have started to reprogram lsd in c by using lsd's output as a reference. having gone into details, i have noticed, that gnu ls is showing more information than lsd when it comes to links. from lsd, i kinda would have expected the output of my own solution, see the screenshots below.

as far as i understand, this is the same topic like this isue 760..

you can find my project here. it should compile on linux without any dependencies other than the gnu libraries. mind it is a work in progress.

Expected behaviour on linux from lsd

(i have worded out the screen shots below, probably rather useless, but i tried to follow the form.)

(red) [link icon] dead link --> (red) [icon] dangling link target
(bold green) [dir link icon] link to dir --> (bol blue) [dir icon] link target dir
(bold green) [dir link icon] link to public dir --> (blue on green) [dir icon] link target dir
(bold green) [file link icon] link to file --> (color according to file extension) [file icon] link target file
(bold green) [file link icon] link to pipe --> (orange?) [pipe icon] link target pipe
(bold green) [file link icon] link to socket --> (bold magenta?) [pipe socket] link target socket
(bold green) [file link icon] link to char device --> (bold yellow) [char dev icon] link target character device

Actual behaviour on linux of lsd

(bold green) [icon] dead link --> (white) [no icon] dagling link target
(bold green) [dir or file icon] any other symbolic link --> (bold green) [no icon] any other link target

Comparison of screenshots of gnu ls, lsd and my implementation for some test files on linux

below is an example for the listing of my test symbolic links.

please ignore the "_private_dir" and "_public_dir" entries.

lsdeluxe

any symbolic link has the "dark green" link color. the information content is hence lower than the one of the gnu ls.

image

my own implementation

the symbolic link and the link target have the "correct color", and the link and the link target show the "correct" icon.

in order to add more information to the listing, i have colored the 'l' at the start of the line in accordance with the color of the link target.

note that the "Wood.bmp" is not supposed to be white and the icon is the generic "file icon". i have not yet implemented neither the color nor the icon based on file extensions.

image

gnu ls

the symbolic link and the link target have the "correct color".

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions