hackerb9 / lsix

Like "ls", but for images. Shows thumbnails in terminal using sixel graphics.
GNU General Public License v3.0
3.96k stars 129 forks source link

Fails to detect sixel support under kitty #80

Open gwolf opened 3 weeks ago

gwolf commented 3 weeks ago

I tried to use lsix in kitty 0.35.1, which has sixel support, but lsix reports:

Error: Your terminal does not report having sixel graphics support.

Please use a sixel capable terminal, such as xterm -ti vt340, or
ask your terminal manufacturer to add sixel support.

You may test your terminal by viewing a single image, like so:

  convert  foo.jpg  -geometry 800x480  sixel:-

If your terminal actually does support sixel, please file a bug
report at http://github.com/hackerb9/lsix/issues

Please mention device attribute codes: ^[[?62;c
hackerb9 commented 3 weeks ago

What happens when you test your terminal by viewing a single image, like so:

convert  foo.jpg  -geometry 800x480  sixel:-
hackerb9 commented 3 weeks ago

By the way, the device attribute codes indicate that kitty does not support sixel. (There would be 4 in the list if it did). That could be a bug in kitty if it actually can handle sixel graphics.

TiagoferMC commented 3 weeks ago

Kitty has its own image handling format that's superior to sixel as it supports a lot more. A lot of programs that support sixel also support this format. It might be something worth considering adding,

gwolf commented 3 weeks ago

By the way, the device attribute codes indicate that kitty does not support sixel. (There would be 4 in the list if it did). That could be a bug in kitty if it actually can handle sixel graphics.

Right, I did as you suggest, and the call to convert spews out apparent garbage.

I guess it's what @TiagoferMC mentions. I view i.e. images attached to my mail inline by calling chafa --colors 256 --color-space=din99d --symbols=all foo.jpg; I thought chafa was outputting sixels, but its manpage mentions:

-f, --format format
Set output format; one of [iterm, kitty, sixels, symbols]. The default is iterm, kitty or sixels if the connected terminal supports one of these, falling back to symbols ("ANSI art") otherwise.
hackerb9 commented 2 weeks ago

Yes, chafa is some deep magic and perhaps I should replace ImageMagick with it.