feat: add --mime-types option #1597
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.
Resolves #1073
Adds the new option
--mime-types, which when enabled will read file contents to get the MIME type of a file to determine its file type as a fallback, if the file type could not be determined otherwise.MIME type overrides can also be added in
theme.yml.Quick performance test using the command
eza -laT --iconson a directory with ~300k (nested) files of various types, total size ~8GB on a reasonably fast SSD. As expected there is a noticeable runtime impact if the option is enabled, but that is why its disabled by default.main:
PR (default behaviour, option disabled):
PR (option enabled):
Another test with a very slow NFSv3 mount, ~150k files and ~1.4TB of again pretty much all types of files.
Here the runtime impact is much more pronounced, however this should be pretty much the worst case scenario.
main:
PR (default behaviour, option disabled):
PR (option enabled):
The tests on the SSD are the fastest measured in 10 runs, the tests on the network mount the fastest out of 4 runs.