trapd00r/LS_COLORS

Differentiation for symlinks

gibfahn opened this issue · 2 comments

AFAICT symlinks are coloured according to the extension of the link:

LINK target

This makes it difficult to tell from a simple ls whether a file is a symlink, whereas it's a different color in standard color schemes.

What would be ideal would be a format that preserved the color of the extension while adding something else (e.g. underline, inverted colors, or italics, preferably not italics as it doesn't work on many terminals). I understand that may be difficult as underline is already used for .docm .pptxm .pptsm .xlsxm .xltm and LS_COLORS, but it'd make a big difference (at least for me).

LS_COLORS output:

image

gls and ls output on macOS:

image

Orphan links are already highlighted, which is great.

ORPHAN 48;5;196;38;5;232;1

Sorry if this has come up before, couldn't find an issue that mentioned it.

I haven't looked at this closely but I'm not sure dircolors supports it. If you can figure it out, please send a PR because I don't see a downside.

I'm shocked -- shocked! -- to discover we're using underline for MS Office documents. That makes little sense to me. My terminals or fonts don't support it, I guess.

Yeah, looks like you're right, adding support for this would require actually modifying the source for ls, which is not something I have much experience with.

https://github.com/coreutils/coreutils/blob/e5dae2c6b0bcd0e4ac6e5b212688d223e2e62f79/src/ls.c#L350-L362

Thanks for the response though!