hzeller / timg

A terminal image and video viewer.
GNU General Public License v2.0
1.91k stars 73 forks source link

Black screen on tmux #93

Closed bitcoinmeetups closed 1 year ago

bitcoinmeetups commented 1 year ago

Hello,

I'm MB. A very nice and polite guy.

If I run timg in my rpi with ssh it's fine.

But if I run it inside a tmux session over ssh it just produces black screens. I'm always inside tmux so I would like to fix that.

Any idea why that happens and if there is a way to fix it?

(When I say black screen I mean the output is just a big black square or something like that).

hzeller commented 1 year ago

Usually, timg works within tmux just fine (works for me right out of the box without any flags running inside various terminals).

The only reason I can imagine is that if tmux is filtering out characters it deems not to be safe. Maybe try a subset of the UTF8 characters used by giving option -ph to timg.

So for instance make sure you have UTF8 output enabled (probably -u option to tmux). Maybe you also find other features that need enabling with the -T option ?

bitcoinmeetups commented 1 year ago

If I select the area then I can see black and grey boxes.

I should mention, this is a black and white screen. However it can show greyscale. So normally I view the timg images in greyscale just fine.

Ok, so if I select the area then I can see black and grey boxes instead of pitch black square. This seems to indicate that the problem is with colors not being represented by grescales for some reason as is the case if I don't use tmux.

However, both terminals are set to 256 colors as far as I can tell. Unless tmux is somehow set to just 2 colors.

-------- Original Message -------- On Oct 15, 2022, 15:10, Henner Zeller wrote:

Usually, timg works within tmux just fine (works for me right out of the box without any flags running inside various terminals).

The only reason I can imagine is that if tmux is filtering out characters it deems not to be safe. So for instance make sure you have UTF8 output enabled (probably -u option to tmux). Maybe you also find other features that need enabling with the -T option ?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

hzeller commented 1 year ago

If your terminal only understands 8 bit color (256 colors) instead of 24 bit, try the --color8 commandline flag for timg

bitcoinmeetups commented 1 year ago

Ok, after searching a bit I found this solution.

  1. I started a tmux session.

  2. I detached from it.

  3. I ran this command: tmux set-option -sa terminal-overrides ",xterm*:Tc"

  4. I reattached again.

It worked, nice : )

I'm replying from mobile so I cannot close this issue but you can close it.

Thanks for feedback and timg.

-------- Original Message -------- On Oct 15, 2022, 15:10, Henner Zeller wrote:

Usually, timg works within tmux just fine (works for me right out of the box without any flags running inside various terminals).

The only reason I can imagine is that if tmux is filtering out characters it deems not to be safe. So for instance make sure you have UTF8 output enabled (probably -u option to tmux). Maybe you also find other features that need enabling with the -T option ?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

hzeller commented 1 year ago

Cool! Have fun with timg!