Specifically, Yazi uses the command file -bL --mime-type to retrieve the mime-type of files. However, different versions of file may return the same mime-type in different formats.
This can cause inconsistent behavior when the same Yazi configuration is used across systems with different file versions, potentially breaking normal functionality.
Since the x- prefix has been discouraged as per rfc6838#section-3.4, this PR addresses the issue in the builtin mime plugin by replacing all occurrences of "x-" with an empty string ("") to unify them
⚠️ Breaking change
After this PR, all mime-types will no longer include the x- prefix, please remove it from your yazi.toml and theme.toml, for example:
To help users migrate their configurations more easily, I added support for the "spotter" in https://github.com/sxyazi/yazi/pull/1802 — press Tab key on a file to open the spot window, where you can view or copy the file's new mime-type.
This PR aims to fully resolve discrepancies across different versions of
file(1)
.Specifically, Yazi uses the command
file -bL --mime-type
to retrieve the mime-type of files. However, different versions offile
may return the same mime-type in different formats.Older versions include the
x-
prefix:while newer versions omit it:
This can cause inconsistent behavior when the same Yazi configuration is used across systems with different
file
versions, potentially breaking normal functionality.Since the
x-
prefix has been discouraged as per rfc6838#section-3.4, this PR addresses the issue in the builtinmime
plugin by replacing all occurrences of"x-"
with an empty string (""
) to unify them⚠️ Breaking change
After this PR, all mime-types will no longer include the
x-
prefix, please remove it from youryazi.toml
andtheme.toml
, for example:To help users migrate their configurations more easily, I added support for the "spotter" in https://github.com/sxyazi/yazi/pull/1802 — press
Tab
key on a file to open the spot window, where you can view or copy the file's new mime-type.