eylles / vifm-sixel-preview

vifm image previews for sixel capable terminals
24 stars 1 forks source link

[foot terminal] [vifm] image blinks 2 times and then disappears #4

Open akhiljalagam opened 1 year ago

akhiljalagam commented 1 year ago

On the first preview, the image blinks 2 times and then disappears. It shows up from the second time.

terminal: foot
TERM: foot
shell: zsh
vifm: Version: 0.12
eylles commented 1 year ago

ah sorry, i have not updated this in quite a long time and i use xterm, rn i'm back to using ueberzug and been tweaking my own fork of vifmimg.

anyway the cause to your problem could be the sixel scrolling mode, DECSDM, there was quit the discussion about it some time ago about what the correct default was supposed to be, with xterm even changing it's historic default for a while, try to run echo '\e[?80l' before starting vifm, my bet is that will help.

as for this i'm considering combining it with vifmimg and have a "one size fits all" solution to display images on terminals inside vifm, wich will be a bash wrapper that will determine what image preview method can be used if any and then set up the environment for vifm, then a "dumb" img-prev script that will just use the avaible method to show something, be it the image or just text info of the file.

akhiljalagam commented 1 year ago

Tried echo '\e[?80l', no luck.

akhiljalagam commented 1 year ago

By modifying the vifm config, I can resolve the blinking problem. You should add %pu to successfully resolve the issue.

fileviewer <image/*>
\ vifm-sixel draw %pw %ph %c %pd %pu
\ %pc
\ vifm-sixel clear

from the vifm manpage:

   %pu       uncached preview.  Intended to be used for commands that just
            send file path somewhere for preview.
eylles commented 1 year ago

thanks, refactoring this is still on my todo list but haven't gotten to it.