Skip to content

Instantly share code, notes, and snippets.

@cjtapper
Forked from joshuarli/macos-tmux-256color.md
Created June 30, 2023 00:58
Show Gist options
  • Select an option

  • Save cjtapper/a375b0fff7b0b58776a2a0008b123606 to your computer and use it in GitHub Desktop.

Select an option

Save cjtapper/a375b0fff7b0b58776a2a0008b123606 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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment