Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
true color in tmux?
true color in tmux?
Hi,
I am using tmux 3.1c-1 in Debian testing and for some reason I cannot get true colors to work.
Both with kitty and with st, the terminal itself shows true colors (I have a script to output a colored line where you can see if you have true colors or not) but in both terminals as soon as I run tmux the true color support is gone.
I assume this is just a matter of proper configuration, but just to avoid wasting time:
Is the tmux-version in the debian repos capable of true colors at all?
Is anyone using a terminal+tmux combination with true colors successfully?
Many thanks!
EDIT:
Figured it out. "set -ga terminal-overrides ",*256col*:Tc" in tmux.conf did the trick.
I am using tmux 3.1c-1 in Debian testing and for some reason I cannot get true colors to work.
Both with kitty and with st, the terminal itself shows true colors (I have a script to output a colored line where you can see if you have true colors or not) but in both terminals as soon as I run tmux the true color support is gone.
I assume this is just a matter of proper configuration, but just to avoid wasting time:
Is the tmux-version in the debian repos capable of true colors at all?
Is anyone using a terminal+tmux combination with true colors successfully?
Many thanks!
EDIT:
Figured it out. "set -ga terminal-overrides ",*256col*:Tc" in tmux.conf did the trick.
Re: true color in tmux?
That gave you true color (24 bits per pixel, 16.7 million colors) in tmux?morgon wrote: EDIT:
Figured it out. "set -ga terminal-overrides ",*256col*:Tc" in tmux.conf did the trick.
Re: true color in tmux?
I set TERM=tmux-265color in my bashrc and also have "set -g default-terminal "tmux-256color"" in my tmux.conf (that may be redunant, but I am currently not in the mood to experiment further).
That (together with the above) gives me true-colors in tmux when run in a terminal that supports it. Works for me in st and kitty.
That (together with the above) gives me true-colors in tmux when run in a terminal that supports it. Works for me in st and kitty.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: true color in tmux?
Never set TERM manually, it can cause strange problems.morgon wrote:I set TERM=tmux-265color in my bashrc
And for the record: https://gist.github.com/XVilka/8346728
deadbang
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: true color in tmux?
You don't. The terminal (or application) should set the appropriate TERM itself so that the correct terminfo file is referenced.
deadbang
Re: true color in tmux?
Do you really understand all the intricacies involved here (because I definitely don't)?
Just one example:
Not setting TERM means xterm will set TERM to "xterm".
But what if you want "xterm-256color"?
Then you have to set that manually...
I've run into much more strange problems NOT setting TERM manually, but maybe you are right...
Just one example:
Not setting TERM means xterm will set TERM to "xterm".
But what if you want "xterm-256color"?
Then you have to set that manually...
I've run into much more strange problems NOT setting TERM manually, but maybe you are right...
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: true color in tmux?
No, not really. My advice to avoid setting TERM manually is based on *many* problem threads over at the Arch forums caused by doing just that.morgon wrote:Do you really understand all the intricacies involved here (because I definitely don't)?
Why would you want that? I see 256 colour support in xterm even if TERM just specifies "xterm" (using the 'colortest-256' command from the colortest package).morgon wrote:But what if you want "xterm-256color"?
deadbang
Re: true color in tmux?
Funny...
I can see true-color support in xterm even when TERM is just "xterm" - and I did not expect that.
So why is there a "xterm-256color" entry at all?
But when you then start tmux TERM (in my config at least) is set to "tmux-256color" (not too surprising I guess) - but true color support is gone...
As I said I don't really understand all of this.
This is all legacy crap - if it works fine (I've got a setup that gives me what I want), and if it doesn't then it's time to experiment with TERM...
That's my gist at least...
I can see true-color support in xterm even when TERM is just "xterm" - and I did not expect that.
So why is there a "xterm-256color" entry at all?
But when you then start tmux TERM (in my config at least) is set to "tmux-256color" (not too surprising I guess) - but true color support is gone...
As I said I don't really understand all of this.
This is all legacy crap - if it works fine (I've got a setup that gives me what I want), and if it doesn't then it's time to experiment with TERM...
That's my gist at least...
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: true color in tmux?
Hmm, this works for me with xterm if "set -ga terminal-overrides ",*256col*:Tc" is in ~/.tmux.conf:
But TERM in tmux is set to "screen" afterwards ¯\_(ツ)_/¯
Code: Select all
TERM=xterm-256color tmux
deadbang
Re: true color in tmux?
It depends on your tmux-config...
With the mentioned terminal-override in tmux.conf I get the behavour that when I start tmux in st, xterm or kitty I still get true colors ONLY IF TERM has been set manually to something ending in "-265color".
If I do not set TERM in bashrc I get the behaviour that true-colors work in st, xterm and kitty but is lost when you start tmux.
Now I do not run a terminal without tmux and so I see real benefit in setting TERM manually...
There may however be ways to get <some-terminal>+tmux with true colors without setting TERM manually, however I can't really be bothered to explore that any further as my setup gives me what I want.
Nevertheless I would be interested in the general question on whether or not you should set TERM manually - however I currently cannot see a way to avoid it...
With the mentioned terminal-override in tmux.conf I get the behavour that when I start tmux in st, xterm or kitty I still get true colors ONLY IF TERM has been set manually to something ending in "-265color".
If I do not set TERM in bashrc I get the behaviour that true-colors work in st, xterm and kitty but is lost when you start tmux.
Now I do not run a terminal without tmux and so I see real benefit in setting TERM manually...
There may however be ways to get <some-terminal>+tmux with true colors without setting TERM manually, however I can't really be bothered to explore that any further as my setup gives me what I want.
Nevertheless I would be interested in the general question on whether or not you should set TERM manually - however I currently cannot see a way to avoid it...
Re: true color in tmux?
You're probably missing the right config in tmux to enable the truecolor setting. It'll look something like:
set -g default-terminal 'screen-256color'
set -ga terminal-overrides ',screen-256color:Tc'
Also worth mentioning, I think this requires at least tmux 2.2, and won't work with earlier versions
myfordbenefits
set -g default-terminal 'screen-256color'
set -ga terminal-overrides ',screen-256color:Tc'
Also worth mentioning, I think this requires at least tmux 2.2, and won't work with earlier versions
myfordbenefits