feat: use ANSI colors for default LS_COLORS #1766
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, if LS_COLORS is unset,
fdfalls back to a hardcoded color scheme. While these hardcoded colors look fine on most dark backgrounds, they are not guaranteed to work well on light themes - or even all dark themes - because the fixed colors may clash with the user's terminal palette.Even when contrast is acceptable, hardcoded colors can conflict with the overall tone or saturation of the theme, whereas the terminal-defined colors will always match overall look.
Comparison using the Adwaita theme(default theme/ANSI):
ANSI colors tend to provide better contrast because they are used by many tools, including

lsitself. Here’s a clearer demonstration of the problem: even without LS_COLORS,lsfalls back to reasonable highlighting, whilefddoes not. And it's not about the specific colors looking better - it's about consistency.I'm using dircolors simply because it's the easiest way to generate an ANSI-based LS_COLORS table, but other sources could work too (e.g., extended themes for more filetypes). btw,
vividcurrently lacks support for a ANSI themes, AFAIK. The key thing is to rely on terminal-provided colors by default.Would be happy to hear thoughts on this!