Closed xfzv closed 1 week ago
% mimetype -bL test-1.json
What is the mimetype
program? Is it an alias for file(1)
(which is used by Yazi)? What does file -bL test-2.json
output?
% mimetype -bL test-1.json
What is the
mimetype
program? Is it an alias forfile(1)
(which is used by Yazi)?
I'm using Gentoo:
% qfile mimetype
dev-perl/File-MimeInfo: /usr/bin/mimetype
% qlist -Iv dev-perl/File-MimeInfo
dev-perl/File-MimeInfo-0.330.0
% mimetype --version
mimetype 0.33
What does
file -bL test-2.json
output?
% file -bL test-2.json
JSON text data
% file -bL test-1.json
New Line Delimited JSON text data
Now what's the output of file -bL --mime-type test-1.json
and file -bL --mime-type test-2.json
?
% file -bL --mime-type test-1.json
application/x-ndjson
% file -bL --mime-type test-2.json
application/json
The following allows me to open the file with either <o>
or <Enter>
:
# ~/.config/yazi/yazi.toml
[open]
rules = [
# ..
{ mime = "application/{json,x-ndjson}", use = [
"edit",
"reveal",
] },
# ..
]
but preview is still not working with:
# ~/.config/yazi/yazi.toml
previewers = [
# ..
# JSON
{ mime = "application/{json,x-ndjson}", run = "json" },
# ..
]
Thanks for the reporting, should be fixed in https://github.com/sxyazi/yazi/pull/1190, please give it a try (make sure you're using the default Yazi config)
Thank you! Can confirm it works fine now with https://github.com/sxyazi/yazi/commit/696dcf2668770b09839424a825b06d2ff7556b1f
% yazi --version
Yazi 0.2.5 (696dcf2 2024-06-23)
What system are you running Yazi on?
Linux X11
What terminal are you running Yazi in?
kitty 0.34.1
Did you try the latest code to see if this problem got fixed?
Tried, but the problem still
yazi --debug
outputDescribe the bug
Opening/previewing regular
json
files works just fine. However, I have ajson
file which is actually a "New Line Delimited JSON text data" and this one can neither be opened (pressing "o" / "Enter" does nothing) or previewed (see screenshot). Works fine withLf
.test-1.json
Manually editing the formatting to turn the file into a regular
json
file solves the issue:test-2.json
Expected Behavior
"New Line Delimited JSON text data" files are opened/previewed just fine like regular JSON files.
To Reproduce
file.json
with the following content:yazi
and highlightfile.json
: no previewConfiguration
can reproduce without
~/.config/yazi
directory (stock config)Anything else?
~/.local/state/yazi/yazi.log
is empty