Closed Saafo closed 8 months ago
Please do file -bL --mime-type filename
on these files, and then paste the output here.
That's so weird, could you upload those files and let me try to reproduce it?
Yes! It's so weird. I've tried to copy print.sh
to another folder, and the options are correct.
print.sh.zip
Could this be due to extended attributes in macOS? I noticed that the output of ls -al now includes an @ symbol.
Could this be due to extended attributes in macOS? I noticed that the output of ls -al now includes an @ symbol.
I've also thought about it but they all have macOS attrs:
(I've changed the attr of print.sh
, but the issue still exist.)
After downloading the print.sh file, I noticed such a symbol. Is this expected behavior? Initially, I thought it was because I used the / for searching, which caused this, but after exiting Yazi and searching for other files, I couldn't replicate this behavior
After downloading the print.sh file, I noticed such a symbol. Is this expected behavior? Initially, I thought it was because I used the / for searching, which caused this, but after exiting Yazi and searching for other files, I couldn't replicate this behavior
Do you have Nerd Fonts installed?
Yes, This is the result of my fc-list.
/Users/evpeople/Library/Fonts/SymbolsNerdFont-Regular.ttf: Symbols Nerd Font:style=Regular
/Users/evpeople/Library/Fonts/SymbolsNerdFontMono-Regular.ttf: Symbols Nerd Font Mono:style=Regular
/Users/evpeople/Library/Fonts/Go Mono Nerd Font Complete.ttf: GoMono Nerd Font:style=Book
/Users/evpeople/Library/Fonts/Go Mono Nerd Font Complete Mono.ttf: GoMono Nerd Font Mono:style=Book
What's your Nerd font version? Can it render properly, if you paste this line to your terminal?
It looks like this on my side:
Could this be due to extended attributes in macOS? I noticed that the output of ls -al now includes an @ symbol.
I've also thought about it but they all have macOS attrs: (I've changed the attr of
print.sh
, but the issue still exist.)
Unfortunately, I can't reproduce it by using your file, could you try building Yazi from the main branch to see if the problem still? https://yazi-rs.github.io/docs/installation#build-from-source
Unfortunately, I can't reproduce it by using your file, could you try building Yazi from the main branch to see if the problem still? https://yazi-rs.github.io/docs/installation#build-from-source
Ok, I'll build it tomorrow. If this issue still exist, can I add some log at somewhere to find out how it happens?
*.sh" , text = "", fg = "#4d5a5e" },
Thank you, I found out it was because I hadn't configured the nerd font for Warp that I am using.
What's your Nerd font version? Can it render properly, if you paste this line to your terminal?
It looks like this on my side:
This is amazing, it's my first time discovering that Yazi has so many cute icons.
Unfortunately, I can't reproduce it by using your file, could you try building Yazi from the main branch to see if the problem still? https://yazi-rs.github.io/docs/installation#build-from-source
I've build from the latest main branch, and the issue still exist. Where can I add log or do something to find out why this happens?
@sxyazi I thought there should exist an out-of-order issue:
I add a log at here:
and here is the result:
file | mime |
---|---|
print.sh | video/quicktime |
print.swift | application/octet-stream |
print2.sh | text/plain |
mov.mp4 | text/x-script.python |
And here is the file list in this folder:
Please add logs next to this line and then see what happens:
@sxyazi It's already incorrect. (some file name had been renamed because of privacy)
{
/Users/saafo/Downloads/print.swift: "application/octet-stream",
/Users/saafo/Downloads/mock_output.py: "image/avif",
/Users/saafo/Downloads/usercard-detail.js: "text/plain",
/Users/saafo/Downloads/xcb.swift: "text/plain",
/Users/saafo/Downloads/print2.sh: "text/plain",
/Users/saafo/Downloads/add_prefix.py: "text/x-script.python",
/Users/saafo/Downloads/IMG_7254.AVIF: "video/quicktime",
/Users/saafo/Downloads/mock_output.sh: "image/png",
/Users/saafo/Downloads/mov.mp4: "text/x-script.python",
/Users/saafo/Downloads/box4.stl: "application/octet-stream",
/Users/saafo/Downloads/test.log: "text/plain",
/Users/saafo/Downloads/bugheic.HEIC: "image/heic",
/Users/saafo/Downloads/mess_thumb.png: "image/heic",
/Users/saafo/Downloads/demo_thumb.png: "image/png",
/Users/saafo/Downloads/somepdf.pdf: "text/x-shellscript",
/Users/saafo/Downloads/Simulator Screen Recording.mp4: "video/mp4",
/Users/saafo/Downloads/docckit: "application/x-mach-binary",
/Users/saafo/Downloads/someapp.dmg: "text/x-shellscript",
/Users/saafo/Downloads/xcb.sh: "text/plain",
/Users/saafo/Downloads/print.sh: "video/quicktime",
}
Then apply this patch:
--- /yazi-plugin/preset/plugins/mime.lua
+++ /yazi-plugin/preset/plugins/mime.lua
@@ -3,6 +3,7 @@ local M = {}
function M:preload()
local urls = {}
for _, file in ipairs(self.files) do
+ ya.err("file.url: " .. tostring(file.url))
urls[#urls + 1] = tostring(file.url)
end
@@ -33,6 +34,7 @@ function M:preload()
break
end
+ ya.err("next: " .. next)
next = next:gsub("[\r\n]+$", "")
if ya.mime_valid(next) then
j, mimes[urls[i]] = j + 1, next
And paste your ~/.local/state/yazi/yazi.log
content here
@sxyazi
I ground it a bit, starting from the docckit
file, the file generated inconsistent output lines:
/Users/saafo/Downloads/SimulatorScreen Recording.mp4 : video/mp4
/Users/saafo/Downloads/add_prefix.py : text/x-script.python
/Users/saafo/Downloads/box4.stl : application/octet-stream
/Users/saafo/Downloads/bugheic.HEIC : image/heic
/Users/saafo/Downloads/demo_thumb.png : image/png
/Users/saafo/Downloads/docckit : application/x-mach-binary
/Users/saafo/Downloads/fmp4.mp4 : /Users/saafo/Downloads/docckit (for architecture x86_64): application/x-mach-binary
/Users/saafo/Downloads/goodheic.HEIC : /Users/saafo/Downloads/docckit (for architecture arm64): application/x-mach-binary
/Users/saafo/Downloads/IMG_7254.AVIF : video/quicktime
/Users/saafo/Downloads/mess_thumb.png : image/heic
/Users/saafo/Downloads/mock_output.py : image/avif
/Users/saafo/Downloads/mock_output.sh : image/png
/Users/saafo/Downloads/mov.mp4 : text/x-script.python
/Users/saafo/Downloads/someapp.dmg : text/x-shellscript
/Users/saafo/Downloads/print.sh : video/quicktime
/Users/saafo/Downloads/print.swift : application/octet-stream
/Users/saafo/Downloads/print2.sh : text/plain
/Users/saafo/Downloads/test.log : text/plain
/Users/saafo/Downloads/usercard-detail.js : text/plain
/Users/saafo/Downloads/xcb.sh : text/plain
/Users/saafo/Downloads/xcb.swift : text/plain
/Users/saafo/Downloads/somepdf.pdf : text/x-shellscript
What kind of file is it? Is it possible to send it to me for testing (if it is not privacy-related)?
Also please do file -bL --mime-type /Users/saafo/Downloads/demo_thumb.png /Users/saafo/Downloads/docckit /Users/saafo/Downloads/fmp4.mp4
then paste the output here.
@sxyazi Sorry this file is privacy-related, I cannot share it. But it's a unix executable binary file compiled from swift(a command line program).
It seems that the docckit file is a fat/universal/multi-arch binary, so the mime result output has multi lines!
I've got another similar binary file that can be upload if you need it.
I've got another similar binary file that can be upload if you need it.
Yeah please upload it.
Hi, I made a PR trying to fix it, https://github.com/sxyazi/yazi/pull/707, let me know if it works for you!
Hi, I made a PR trying to fix it, #707, let me know if it works for you!
Oh it works! Thanks for the fix!
Thanks for testing! Let's merge it then
I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
What system are you running Yazi on?
macOS
What terminal are you running Yazi in?
Warp / iTerm2
Yazi version
0.2.3
Did you try the latest main branch to see if the problem has already been fixed?
Not tried, and I'll explain why below
Describe the bug
The options in the open options menu of some files are incorrect, for example:
I've got a
print.sh
and aprint.swift
and their options are incorrect:Then I create a
print2.sh
and this time the options are correct:Their attributes are basically the same:
Besides, I've got a
mov.mp4
file and its options are incorrect either(but another file namedfmp4.mp4
is correct):And here is the file list in yazi:
It's interesting that one of the two mp4 files is yellow, and one of the two shell files is yellow. I'm using the default configuration.
Expected Behavior
All shell files and swift files should contains the
$EDITOR
option, and all video files should contains the play option(mpv)To Reproduce
I've got no idea temporarily, do you have and ideas about how this happened?
Configuration
no config
Anything else?
No response