Skip to content

fix: make EZA_COLORS=reset clear built-in styles#1718

Open
martenlienen wants to merge 1 commit intoeza-community:mainfrom
martenlienen:marten/eza-colors-reset
Open

fix: make EZA_COLORS=reset clear built-in styles#1718
martenlienen wants to merge 1 commit intoeza-community:mainfrom
martenlienen:marten/eza-colors-reset

Conversation

@martenlienen
Copy link
Copy Markdown

Description

This PR fixes EZA_COLORS=reset to actually do what the documentation says, i.e. reset eza's styles to plain and disabling the default theme. At the moment, resetting the colors has no effect.

How Has This Been Tested?

I have added CLI tests to verify the correct coloring given EZA_COLORS=reset and EZA_COLORS=reset:... and the interaction with LS_COLORS.

Fixes #731.

@martenlienen martenlienen force-pushed the marten/eza-colors-reset branch from 96f5d96 to 2593d0c Compare February 14, 2026 11:02
@namurphy
Copy link
Copy Markdown

Thank you for working on this! I'm looking forward to this being merged.

I compiled this branch to try it out. I set EZA_COLORS=reset and removed theme.yml, and all built-in styles were successfully cleared when I ran eza. ✅

When I created a blank theme file with touch ~/.config/eza/theme.yml, the styles were no longer cleared (except for normal filenames).

Could this PR be extended to make EZA_COLORS=reset clear default styles even when theme.yml is present? 🤔 Thank you again!

@martenlienen
Copy link
Copy Markdown
Author

I think mixing theme.yml and EZA_COLORS would be confusing, when theme.yml seemingly intends to avoid use of the environment variable. Instead, I believe it would be better if theme.yml would get its own reset: true attribute to specify if it should inherit from the default or the plain style, but that should go into a separate pull request.

@namurphy
Copy link
Copy Markdown

I think mixing theme.yml and EZA_COLORS would be confusing, when theme.yml seemingly intends to avoid use of the environment variable. Instead, I believe it would be better if theme.yml would get its own reset: true attribute to specify if it should inherit from the default or the plain style, but that should go into a separate pull request.

Agreed that theme.yml should have its own configuration variable! I create #1724 for this suggestion.

Since EZA_COLORS takes precedence over the theme file, should EZA_COLORS=reset also clear the styles defined in theme.yml? 🤔 When I tested this branch, even an empty theme.yml made it so that setting EZA_COLORS=reset didn't work, meaning that the theme file took precedence over EZA_COLORS.

Thank you again for working on this!

@martenlienen
Copy link
Copy Markdown
Author

That precedence problem is also a separate issue from this one I believe. I deliberately do not use the theme file, because I do not want eza to have to read a file from disk every time I use it.

Copy link
Copy Markdown

@namurphy namurphy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there will still be the separate issue that setting EZA_COLORS=reset will not do anything when a theme.yml is in use, adding this caveat to the documentation would likely help prevent confusion by users who have a theme.yml and want to do this reset.

Since #1724 proposes adding a configuration variable within theme.yml to perform this reset, I'll add a note there to update the documentation near the discussion about EZA_COLORS=reset.

Thank you again for submitting this!

So setting `EZA_COLORS="reset:*.txt=31"` will highlight only text
files; setting `EZA_COLORS="reset"` will highlight nothing.
You can also disable eza's built\-in mappings entirely by including a `reset` entry at the beginning of `EZA_COLORS`.
So setting `EZA_COLORS="reset:*.txt=31"` will highlight only text files in addition to any styles in `LS_COLORS`; setting `EZA_COLORS="reset"` disables eza's built\-ins completely.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
So setting `EZA_COLORS="reset:*.txt=31"` will highlight only text files in addition to any styles in `LS_COLORS`; setting `EZA_COLORS="reset"` disables eza's built\-ins completely.
So setting `EZA_COLORS="reset:*.txt=31"` will highlight only text files in addition to any styles in `LS_COLORS`; setting `EZA_COLORS="reset"` disables eza's built\-ins completely.
However, setting `EZA_COLORS="reset"` is not yet supported when a configuration file (`theme.yml`) is in use.

You can also disable this built-in set entirely by including a `reset` entry at the beginning of `EZA_COLORS`.
So setting `EZA_COLORS="reset:*.txt=31"` will highlight only text files; setting `EZA_COLORS="reset"` will highlight nothing.
You can also disable eza's built-in mapping entirely by including a `reset` entry at the beginning of `EZA_COLORS`.
So setting `EZA_COLORS="reset:*.txt=31"` will highlight only text files in addition to any styles in `LS_COLORS`; setting `EZA_COLORS="reset"` disables eza's built-ins completely.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
So setting `EZA_COLORS="reset:*.txt=31"` will highlight only text files in addition to any styles in `LS_COLORS`; setting `EZA_COLORS="reset"` disables eza's built-ins completely.
So setting `EZA_COLORS="reset:*.txt=31"` will highlight only text files in addition to any styles in `LS_COLORS`; setting `EZA_COLORS="reset"` disables eza's built-ins completely.
However, setting `EZA_COLORS="reset"` is not yet supported when a configuration file (`theme.yml`) is in use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: more thorough reset

3 participants