Skip to content

Instantly share code, notes, and snippets.

@joshuarli
Forked from bbqtd/macos-tmux-256color.md
Created February 18, 2020 18:20
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save joshuarli/247018f8617e6715e1e0b5fd2d39bb6c to your computer and use it in GitHub Desktop.
Save joshuarli/247018f8617e6715e1e0b5fd2d39bb6c to your computer and use it in GitHub Desktop.
Installing tmux-256color for macOS

Installing tmux-256color for macOS

macOS has ncurses version 5.7 which doesn't ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color you can use screen-256color, place this command into your ~/.tmux.conf.

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

The Right Way

Firstly, we need to install latest version of ncurses by using brew.

$ brew install ncurses

After that, we're going to use infocmp that prints a terminfo description.

$ /usr/local/opt/ncurses/bin/infocmp tmux-256color > ~/tmux-256color.info

Finally, we need to compile the description to our system database and set default-terminal into ~/.tmux.conf.

$ sudo tic -xe tmux-256color tmux-256color.info
set-option -g default-terminal "tmux-256color"

RGB Colors

Also, don't forget to enable RGB. For instance, if you use Alacritty terminfo outside of tmux.

set-option -sa terminal-overrides ",alacritty:RGB"
@YodaEmbedding
Copy link

A good resource which explains each step in detail:
https://gpanders.com/blog/the-definitive-guide-to-using-tmux-256color-on-macos/

@garlandcrow
Copy link

Thank you for putting a tourniquet on the time bleed of looking on how to fix this :)

@Fadyio
Copy link

Fadyio commented Jun 23, 2023

Thank you!

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