hpjansson / chafa

📺🗿 Terminal graphics for the 21st century.
https://hpjansson.org/chafa/
GNU Lesser General Public License v3.0
2.94k stars 64 forks source link

Iterm support not detected #196

Closed sudo-burger closed 7 months ago

sudo-burger commented 7 months ago

Using iTerm2 3.50beta22 on MacOS Ventura 13.6.6/Intel. $ chafa --version Chafa version 1.14.0

Loaders: GIF JPEG PNG QOI SVG TIFF WebP XWD Features: mmx sse4.1 popcnt avx2 Applying: mmx sse4.1 popcnt avx2 [...]

Chafa doesn't seem to detect the iTerm capabilities, resulting in pixelated output. Setting '--format iterm' gives the expected, good quality output.

A few environment variables; based on a quick read of the code, chafa should be able to detect it is running in iTerm by reading a couple of these:

$ env|grep TERM|sort COLORTERM=truecolor ITERM_PROFILE=Default LC_TERMINAL=iTerm2 LC_TERMINAL_VERSION=3.5.0beta22 TERM=xterm-256color TERMINFO_DIRS=/Applications/iTerm.app/Contents/Resources/terminfo:/usr/share/terminfo TERM_FEATURES=T3CwLrMSc7UUw9Ts3BFGsSyHNoSxF TERM_PROGRAM=iTerm.app TERM_PROGRAM_VERSION=3.5.0beta22

Output with no --format flag: $ chafa Downloads/Lenna_(test_image).png

Screenshot 2024-03-29 at 17 44 06

Output with '--format iterm': $ chafa --format iterm Downloads/Lenna_(test_image).png

Screenshot 2024-03-29 at 17 45 12
hpjansson commented 7 months ago

Thanks for filing the issue! Found the cause, fix will be on master and in the next release.

sudo-burger commented 7 months ago

Awesome. Thank you!

junegunn commented 5 months ago

Thanks for fixing this! Any plan to cut a new release?

hpjansson commented 5 months ago

Yes, very soon now - I wanted to close out #184 first, but it looks like it might not be an endianness/crash issue on our end, so will punt on that one unless my latest finding is contradicted.

hpjansson commented 5 months ago

@junegunn And it's done!

junegunn commented 5 months ago

Thanks! I can confirm that the problem's fixed.