Skip to content

Instantly share code, notes, and snippets.

@parmort
Created March 26, 2018 21:47
Show Gist options
  • Save parmort/4d95555b3f9435fa953f0b7c67c86e8f to your computer and use it in GitHub Desktop.
Save parmort/4d95555b3f9435fa953f0b7c67c86e8f to your computer and use it in GitHub Desktop.
Tmux TrueColor Setup

Tmux TrueColor (a.k.a. 24-bit color) Support

Prerequisites

To enable TrueColor for Tmux, you must make sure that you have two things:

  1. Tmux version 2.2 or higher. You can find out your version by running tmux -V
  2. You have a terminal that supports TrueColor (it may also be referenced by 24 bit color. To check if you do, run
  curl -s https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh | bash

Testing TrueColor

Now that you have that done, you can enable TrueColor.

  1. Run echo $TERM in your terminal. It should get you something like this: xterm-termite. Whatever you do get, remember it for later.
  2. To test it, enter Tmux, and run tmux set-option -ga terminal-overrides ",xterm-termite:24-bit-color"
  3. Now, if TrueColor is set up correctly, you should see a smooth transition between the colors.

Saving changes

If all checks out, the only thing left to do is save it.

If you have not done so already, create a .tmux.conf file in your home directory (~)

Put this in the file

set -g default-terminal "xterm-termite"

Of course, replace xterm-termite with whatever output you got from echo $TERM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment