atanunq / viu

Terminal image viewer with native support for iTerm and Kitty
MIT License
2.57k stars 58 forks source link

Works fine with 24bit outside tmux, falls back to lower color support inside tmux #45

Closed Kabouik closed 4 years ago

Kabouik commented 4 years ago

First of all, thanks a lot. viu is an amazing tool, I love it.

I set export COLORTERM='24bit' in my ~/.bashrc, and now viu works pretty well outside tmux. However, inside tmux next-3.2, and despite echo $COLORTERM still returning 24bit, viu fails to use 24bit colours and falls back to a base support.

Is this a known issue and would you know how I can fixe it? Thanks a lot.

Kabouik commented 4 years ago

For others in my situation, this was due to tmux not knowing it can use true colors. Adding this in ~/.tmux.conf enabled true colors inside tmux:

set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color*:Tc"
atanunq commented 4 years ago

Hi, sorry I could not answer your queries on time. I am glad you got it sorted, thanks for posting the solution and the kind words!

Kabouik commented 4 years ago

Sadly I might have spoken too fast!

This is outside tmux:

ss-2020-06-03_210911

TERM outside tmux is xterm-color256.

And this is inside tmux: ss-2020-06-03_210952

From inside tmux still:

[nemo@Sailfish ~]$ tmux info | grep Tc
 217: Tc: (flag) true
 217: Tc: (flag) true

Any ideas?

atanunq commented 4 years ago

Hmm, that looks weird. It looks like it cannot print (or color) the half blocks correctly.

Just guessing, but can you echo ▄? Other than that I am not sure what to inspect, maybe fonts?

Kabouik commented 4 years ago

The example above was from Tilix in a SSH session. But I have had similar (but more obvious) issue with lines in the preview in havoc terminal in issue #44? Maybe it's related?

However the lines normally only show in havoc when I'm outside tmux, and could be just a font issue as the dev told me earlier. And I don't understand why tmux would make any difference. In both cases (SSH with Tilix or directly on device with havoc), the preview is better outside tmux.

Tilix SSH:

[nemo@Sailfish ~]$ echo ▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄

Output on device when run in havoc:

[nemo@Sailfish ~]$ havoc -l echo ▄▄▄▄▄▄▄▄

Screenshot_20200603_021

atanunq commented 4 years ago

Thanks for trying, but I am afraid I can't help. It is a bit too niche of a setup to reproduce and debug.

Kabouik commented 4 years ago

Thanks, I undestand, no worries.

On Jun 3 2020, at 10:12 pm, Atanas Yankov notifications@github.com wrote:

Thanks for trying, but I am afraid I can't help. It is a bit too niche of a setup to reproduce and debug. — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub (https://github.com/atanunq/viu/issues/45#issuecomment-638435977), or unsubscribe (https://github.com/notifications/unsubscribe-auth/ABWHHQYWDDOZI4PGGYYUHXDRU2VCLANCNFSM4NRXUSIQ).

levone1 commented 2 years ago

@Kabouik @atanunq - Curious... I have just started using nnn on Linux Mint with Kitty, and found the same issue here, (which I already commented to kabouik about on Openrepos, having to do with Sailfish OS). I'm just wondering - what is it that makes the difference? Why is it that Kitty, (and I guess ITerm, which I've never used), can display images in the terminal with high-res, but no other terminals or image viewing programs can? Is whatever makes it possible something that could be coded into a different terminal or app, and make it be the same?