viu
viu copied to clipboard
Viuing images in vim's terminal
I saw the #45 and it was closed because it was too niche so I presume this is even too niche for the "too niche" category.
In short, when trying to use viu
from within vim
's :terminal
I only get what looks like a base64
of the image and the program halts, and then after pressing <Ctrl-C>
I get a bunch of characters instead of any kind of image.
Example of the output:
Gi=31,s=1,v=1,a=q,t=t;L3Zhci9mb2xkZXJzLzM1L2s5cjVwOXNzN3RsZDkwZHBmOXhucXE3NDAwMDBnbi9ULy50bXAudml1ZXIuQg==
<I press ctrl-c here>
ov/nIyK/52Ni/+aiov/nIuM/5qMjP+bjY3/mYuL/5mLi/+ajIz/nI+P/5yLjP+ZiYr/mouJ/5qLif+Zi4v/mIqK/5iKiv+Zi4v/mYuJ/5mLif+Yior/mIqK/5mLi/+Zi4v/mIqK/5iKiv+ci4z/moqL/5qLif+Xh4b/lYWB/5aGgv+Yioj/lomH/5iKiv+WiYn/l4eG/5eHhv...
The terminal
states both $TERM
and $COLORTERM
are xterm-kitty
and truecolor
, respectively. Running viu
from outside vim
works as expected.
Steps to reproduce with vim 8.2 (2019 Dec 12, compiled Jun 26 2021 10:02:55)
:
vim -Nu NONE +terminal
viu /path/to/image
When running it from vim
within tmux
though, I get a low-resolution image that is slowly printed (probably due to vim
redrawing it constantly), but there $TERM
is xterm-256color
, $COLORTERM
is truecolor
.
I'm also trying to use it inside Neovim terminal. I have the same issue. It would be great to run it from within neovim :D
Same happens if viu
used for preview within vifm.
Not only that, but it starts hogging up memory until it's killed. I'm using vifm
with kitty
.