dotcs / xkcd-cli

A xkcd terminal viewer that uses fzf for searching and renders images directly in terminals that support image rendering (e.g., kitty, iterm2, any other with sixel support)
Other
25 stars 1 forks source link

No images found in “file:///tmp/tmp9djd4fc9/2870.png”. #7

Open miostreams opened 11 months ago

miostreams commented 11 months ago

Image correctly displayed when using Kitty, but when attempting to use xdg-open from Kitty or any other terminal, the tmp image file cannot be found.

For example, when using tilda, sixel isn't supported, so the default image viewer is opened, which results in the error message. Additionally, when specifying --no-terminal-graphics from Kitty, the same message is displayed.

Not sure what troubleshooting info will be useful for you. I used inotify-tools in a secondary terminal to monitor the file creation and it appears to be deleted before the file is read by the image viewer:

inotifywait /tmp --monitor
Setting up watches.
Watches established.
/tmp/ CREATE an6plj5d
/tmp/ OPEN an6plj5d
/tmp/ MODIFY an6plj5d
/tmp/ CLOSE_WRITE,CLOSE an6plj5d
/tmp/ DELETE an6plj5d
/tmp/ CREATE,ISDIR tmp9djd4fc9
/tmp/ OPEN,ISDIR tmp9djd4fc9
/tmp/ ACCESS,ISDIR tmp9djd4fc9
/tmp/ CLOSE_NOWRITE,CLOSE,ISDIR tmp9djd4fc9
/tmp/ DELETE,ISDIR tmp9djd4fc9

After these lines are printed in the secondary terminal, the image viewer displays the 'no images found' error message.

miostreams commented 11 months ago

I just ran a second test with recursion turned on in inotify, to also include the filename. This resulted in the following error in the image viewer:

No images found in “file:///tmp/tmpukuvh951/2870.png”.

As well as this output in inotify:

inotifywait /tmp --monitor --recursive
Setting up watches.  Beware: since -r was given, this may take a while!
Watches established.
/tmp/ CREATE 4x3hen5y
/tmp/ OPEN 4x3hen5y
/tmp/ MODIFY 4x3hen5y
/tmp/ CLOSE_WRITE,CLOSE 4x3hen5y
/tmp/ DELETE 4x3hen5y
/tmp/ CREATE,ISDIR tmpukuvh951
/tmp/ OPEN,ISDIR tmpukuvh951
/tmp/ ACCESS,ISDIR tmpukuvh951
/tmp/ CLOSE_NOWRITE,CLOSE,ISDIR tmpukuvh951
/tmp/tmpukuvh951/ CREATE 2870.png
/tmp/tmpukuvh951/ OPEN 2870.png
/tmp/tmpukuvh951/ MODIFY 2870.png
/tmp/tmpukuvh951/ MODIFY 2870.png
/tmp/tmpukuvh951/ MODIFY 2870.png
/tmp/tmpukuvh951/ MODIFY 2870.png
/tmp/tmpukuvh951/ MODIFY 2870.png
/tmp/tmpukuvh951/ MODIFY 2870.png
/tmp/tmpukuvh951/ MODIFY 2870.png
/tmp/tmpukuvh951/ MODIFY 2870.png
/tmp/tmpukuvh951/ MODIFY 2870.png
/tmp/tmpukuvh951/ MODIFY 2870.png
/tmp/tmpukuvh951/ MODIFY 2870.png
/tmp/tmpukuvh951/ MODIFY 2870.png
/tmp/tmpukuvh951/ MODIFY 2870.png
/tmp/tmpukuvh951/ MODIFY 2870.png
/tmp/tmpukuvh951/ CLOSE_WRITE,CLOSE 2870.png
/tmp/ OPEN,ISDIR tmpukuvh951
/tmp/tmpukuvh951/ OPEN,ISDIR 
/tmp/ ACCESS,ISDIR tmpukuvh951
/tmp/tmpukuvh951/ ACCESS,ISDIR 
/tmp/ ACCESS,ISDIR tmpukuvh951
/tmp/tmpukuvh951/ ACCESS,ISDIR 
/tmp/tmpukuvh951/ DELETE 2870.png
/tmp/ CLOSE_NOWRITE,CLOSE,ISDIR tmpukuvh951
/tmp/tmpukuvh951/ CLOSE_NOWRITE,CLOSE,ISDIR 
/tmp/tmpukuvh951/ DELETE_SELF 
/tmp/ DELETE,ISDIR tmpukuvh951