Hi @kovidgoyal, I'm having an issue with previewing images inside vifm using the --place option. I am able to use kitty +kitten icat filename without any issue but when i use the place option i get the error "The --place option can only be used with a single image". I have written a few differenct scripts attempting to address the issue i am certain that only one filename is being passed. My solution was to comment out the if statement in the icat kitten and now image preview works as expected.
https://github.com/kovidgoyal/kitty/blob/master/kittens/icat/main.py#L309
``` if len(items) > 1 or (isinstance(items[0], str) and os.path.isdir(items[0])):
raise SystemExit('The --place option can only be used with a single image')```
Thank you for your efforts with this great terminal emulator :)
I dont see anything wrong with the code and running
kitty +kitten icat --place 10x10@0x0 resources/images/lt.png
works as expected. I need some way to reproduce the problem you are having.
I am not sure I am in the right place to post this, but I tried to do the same.
I managed to preview the file without issues, but the clear option does not work as expected. I added in the vifmrc this:
fileviewer *.jpg,*.jpeg,*png,
\ kitty icat --place=%pwx%ph@%pxx%py %c
\ %pc
\ kitty icat --clear
It seems like the left part of the screen of vifm moves down at every refresh.
I doubt this has anything to do with icat or kitty. icat --clear simply
sends a graphics command to delete all images, it does not affect the
scroll position in any way. As you can test by running it yourself. The
only exception is if you run it and also provide some images, in which
case those images will be displayed after the clear and without --place,
displaying images causes scrolling.
As for the original issue, the problem is that vifm set the stdin of the filviewer program to null instead of the terminal, which breaks icat. I have added a --stdin option to icat to tell it not to try to read images from stding to workaround that. As fo rthe screen moveing after icat, I have no idea, you will need to ask the vifm developers.
@andpalmier try this
fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
\ kitty icat --transfer-mode=file --place=%pwx%ph@%pxx%py %c
\ %pc
\ kitty icat --transfer-mode=file --clear
The problem is that icat sends "Detecting..." to stdout which breaks vifm. Setting --transfer-mode disable detection.
I have added --silent to icat
Thanks, now i do not have my Mac anymore, so I cannot test it there.
Hi. Is reopening this issue alright? I only moved to vifm recently and got this issue: whenever I turn view mode off then on again the terminal "freaks out" and throws stuff onto the screen endlessly.
My setting for previewing is like this:
fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
\ kitty icat --silent --place=%pwx%ph@%pxx%py %c
\ %pc
\ kitty icat --silent --clear
I can work around this by creating a command to manually do kitty icat --clear instead of putting it into the preview command, but it leaves behind a black frame like this

My system info:
Most helpful comment
I have added --silent to icat