sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
14.77k stars 333 forks source link

some (possibly temporary) files are created whenever i have new svg files with yazi version > 0.3 #1419

Closed sga-13 closed 1 month ago

sga-13 commented 1 month ago

What system are you running Yazi on?

Linux Wayland

What terminal are you running Yazi in?

foot

yazi --debug output

```sh ##### ↓↓↓ Paste the output here: ↓↓↓ ##### Yazi Version: 0.3.0 (7a380c2 2024-08-01) Debug : false OS : linux-x86_64 (unix) Ya Version: No such file or directory (os error 2) Emulator Emulator.via_env: ("foot", "") Emulator.via_csi: Ok(Foot) Emulator.detect : Foot Adapter Adapter.matches: Sixel Desktop XDG_SESSION_TYPE: Some("wayland") WAYLAND_DISPLAY : Some("wayland-1") DISPLAY : Some(":0") SSH shared.in_ssh_connection: false WSL /proc/sys/fs/binfmt_misc/WSLInterop: false Variables SHELL : Some("/usr/bin/bash") EDITOR : Some("helix") YAZI_FILE_ONE : None YAZI_CONFIG_HOME : None ZELLIJ_SESSION_NAME: None Text Opener default: Some(Opener { run: "editor-terminal \"$@\"", block: false, orphan: true, desc: "open text files", for_: None, spread: true }) block : Some(Opener { run: "$EDITOR \"$@\"", block: true, orphan: false, desc: "Edit", for_: None, spread: true }) tmux TMUX : false Version: No such file or directory (os error 2) Dependencies file : 5.45 ueberzugpp : No such file or directory (os error 2) ffmpegthumbnailer: 2.2.2 magick : 7.1.1-36 fzf : 0.54.3 fd : No such file or directory (os error 2) rg : No such file or directory (os error 2) chafa : No such file or directory (os error 2) zoxide : No such file or directory (os error 2) 7z : 17.05 7zz : No such file or directory (os error 2) jq : 1.7.1 ```

When reporting a bug, please also upload the yazi.log log file - only upload the most recent content by time. You can find it in the "/home/sg/.local/state/yazi" directory.

Did you try the latest nightly build to see if the problem got fixed?

No, and I'll explain why below

Describe the bug

I am using the linux gnu release https://github.com/sxyazi/yazi/releases/download/v0.3.0/yazi-x86_64-unknown-linux-gnu.zip

i am on arch linux

I do not have inkscape installed, and whenever i have a new svg file in a directory, or move to a directory with svg files, that i have never been to (ones without cache), a file corresponding to each svg is created, with random names (i have attached a zip, which has 41 such files). These files contain only 1 line sh: 1: inkscape: not found As i understand, these must be some temporary files used in preloader/ or to generate preview, and these may be used in case where you have inkscape, or maybe there is some case where inkscape is used to generate some preview, and these are error files generated in case that process fails

For reference, previews for svg files is working

I have also attached 1 such file separately, and also my yazi.toml (had to add .txt in the end because of github), i have all preloaders commented in my yazi.toml after updating to 0.3+, this error did not occur with previous versions

err.zip p_+__W.txt yazi.toml.txt

yazi.log

Minimal reproducer

have a svg file present in a directory with no previous cache, or a fresh svg file, i have also attached a sample svg file for testing 2-particle-collision-export

Anything else?

No response

sxyazi commented 1 month ago

a file corresponding to each svg is created, with random names

Where was this file created? Was it in the same directory as the SVG?

Can you record a GIF to show me what happened?

After you removed magick from your preloaders and previewers in yazi.toml, the problem disappeared, right?

sga-13 commented 1 month ago

i do not have any preloaders active in my config right now, and for previewers, there is a general rule for images as attached

output

sxyazi commented 1 month ago

It seems that this only happens when you use "convert to svg":

pdf2svg = [{ run = 'pdf2svg "$1" "${1%.*}".svg ', orphan = true, desc = "convert to svg", for = "linux" },]

I believe those temporary files are generated by your opener command and are unrelated to Yazi.

sga-13 commented 1 month ago

i removed pdf2svg, and exported to svg from some external program (xournalpp with keyboard shortcut) and this still occurred output

sxyazi commented 1 month ago

Are you sure you used the pdf2svg opener after commenting? I didn't see you select it in the interactive menu. When you open a file directly with o (instead of using O to open it interactively), it uses your first opener, which in this case is open:

open = [{ run = '/home/sg/.local/bin/open-all "$@"', orphan = true, desc = "open", for = "linux" },]

What's in your /home/sg/.local/bin/open-all? What happens if you run /home/sg/.local/bin/open-all /path/to/your-pdf-file directly in the terminal?

sxyazi commented 1 month ago

You could also try using Yazi with the default configuration to see if the issue still by mv ~/.config/yazi ~/.config/yazi-backup.

sga-13 commented 1 month ago

i have changed the shortcuts for yazi (i use enter to open with default, and o to open interactive menu)

also, this time, i did not use pdf2svg to convert to svg, i exported via xournalpp, using a keyboard shortcut (Alt + shift + S)

my point is that this behaviour did not use to occur with older yazi version, and following recording is without my configurations

output

all these files generated without me doing anything, since with fresh config, they probably remake files

i meant cache files

sxyazi commented 1 month ago

I see now, let's reopen it

sxyazi commented 1 month ago

Please try disabling the SVG previewer and preloader to see if the issue still by creating an empty yazi.toml with:

[plugin]
prepend_preloaders = [
    { mime = "image/svg+xml", run = "noop" },
]
prepend_previewers = [
    { mime = "image/svg+xml", run = "noop" },
]
sga-13 commented 1 month ago

well that "fixes" the files from appearing (at the cost of no preview)

sxyazi commented 1 month ago

I think the only possible reason is that these files were generated when executing magick. What happens if you run this command directly from your terminal with your svg filepath?

https://github.com/sxyazi/yazi/blob/52681b19e4ab0d3722e3b8d83231b6cb14b632dd/yazi-plugin/preset/plugins/magick.lua#L23-L33

sga-13 commented 1 month ago

yes, i was alreading fiddling around that pull request

i tried

convert -density 200 -resize 800x600^ -quality 90 /home/sg/study/sem-7/pyl125/notes-me/reciprocal-lattice-unit-cell-export.svg JPG:/home/sg/study/sem-7/pyl125/notes-me/reciprocal-lattice-unit-cell-export.jpg

and yes it creates those files in $pwd

so we can either ask upstream to look at this, or temporarily take a state of files, check for new files that pop up, and then check if they do have the line, if so, delete them

sxyazi commented 1 month ago

It's strange that I'm unable to reproduce the issue using the SVG you provided with

magick -density 200 ~/Downloads/355329878-6ac29875-58c9-48bb-9ee0-1ba4e1010dbd.svg -resize 800x600^ -quality 90 JPG:/tmp/aaa.jpg

It doesn't create any temporary files, my version:

❯ magick --version
Version: ImageMagick 7.1.1-36 Q16-HDRI aarch64 22352 https://imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(5.0)
Delegates (built-in): bzlib fontconfig freetype gslib heic jng jp2 jpeg jxl lcms lqr ltdl lzma openexr png ps raw tiff webp xml zlib zstd
Compiler: gcc (4.2)

I think this might be an issue with Magick itself or possibly with how the distribution packaged it. Could you try downloading the binary from the official website to see if the problem persists?

sga-13 commented 1 month ago

yes, i tried the appimage, no issues, so, it has nothing to do with yazi or magick, sorry to waste so much of your time

github-actions[bot] commented 2 weeks ago

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.