7

dist: Arch Linux.

I have an st build from AUR and tmux from official repo. In st I meet a good TrueColor support that works with last Vim version via termguicolors option. But when i tried to bring this to tmux i faced some issues.

At first time the output of

tmux info | grep Tc

from inside of tmux was

197: Tc: [missing]

after reading tmux man page i found that this option must bring to tmux Tc

set-option -g terminal-overrides "st-256color:Tc"

where from my terminal emulator it returns me:

TERM=st-256color 

But the result of tmux info still was the same. Just for check i installed xterm and tried the same manipulation with it but it didn't give me another result. After all tmux recognizes that terminal support 256 colors and emulates true color via it

3

You could modify your copy of the terminal description to provide this flag:

infocmp -x >foo
edit foo, adding "Tc," after the end of any line ending with a comma
tic -x foo

That would work for ncurses (which is what you have with any Linux distribution), and perhaps NetBSD curses.

  • Thanks it works. But I stil don't understand if this flag is not standard why is it used to check that feature supported? – Anton Rybakov Oct 30 '16 at 20:57
  • tmux and vim both use nonstandard features of the terminal description, requiring users to make odd changes... – Thomas Dickey Oct 30 '16 at 21:09
  • Is there any good and comprehensive documentation of this? And I thought ANSI codes were strange… – phk Oct 30 '16 at 21:19
  • Not really: the feature you're interested in came from some creative interpretation of a little-known ISO standard. The standard as written doesn't exactly say what the feature does - we get only interpretation... – Thomas Dickey Oct 30 '16 at 21:22
0

You need to add -a to append to, rather than override the existing terminal capabilities:

set-option -ga terminal-overrides ",*256*:Tc"

This will work for any terminal which advertises 256 colours.

Check that you don't have another set -g terminal-overrides somewhere later in your config file, too.


For vim, you'll probably also want:

set -g default-terminal "screen-256color"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.