atanunq / viuer

Rust library for displaying images in the terminal.
MIT License
241 stars 43 forks source link

Program hangs when displaying image with `use_kitty: true` #30

Closed lilithium-hydride closed 2 years ago

lilithium-hydride commented 3 years ago

When setting the use_kitty: config option for viuer to true and attempting to display an image, the program will hang (seemingly indefinitely) and must be forcibly killed. No image is displayed. Setting this option to false allows everything to work as expected, albeit with blocks instead of a proper Kitty image. This is almost certainly a bug in my program, although I can't imagine what would cause such behavior and if anyone has any ideas I'd appreciate it :D

atanunq commented 3 years ago

Hello! What environment are you running in? Is it in Kitty? Also, is it in a tty?

Kitty has two levels of operation - local (by sending a file name) & remote (by sending the whole image encoded in terminal sequences). The first one is faster, but the logic to detect that is here. It is basically asking the terminal whether it can successfully print an image using the first method. However, I suspect in your case it is waiting for a response indefinitely. This usually happens if you are piping the output of viuer somewhere else, e.g | head.

This should be fixed on viuer's side, to be honest.

lilithium-hydride commented 3 years ago

I'm in x11, it's with Kitty, and it's not being piped anywhere. Running it in another terminal (I tried urxvt) does not cause it to hang. My guess is that, similarly to my previous issue, it's in raw mode and Kitty probably doesn't send the response that viuer expects.

lilithium-hydride commented 2 years ago

Doesn't seem to be much in the way of development here anymore, but it's worth mentioning that this seems to have resolved itself since I filed the issue. Closing.

ghost commented 2 years ago

I have same issue now kitty 0.24.2

songww commented 1 year ago

I have same issue kitty 0.26.5

It stopped working after a dozen images were displayed.

adri326 commented 1 year ago

Exact same issue, stops working after ~30 images