Working around Apple's broken terminal infrastructure to make tmux colours work correctly in curses applications.

Use macOS's tic

Make sure the terminfo compiler on PATH is macOS's own:

$ which tic

Install definitions

Then download and unpack the definitions, and compile the interesting ones:

curl -LO https://invisible-island.net/datafiles/current/terminfo.src.gz
gunzip terminfo.src.gz
tic -xe alacritty-direct,tmux-256color terminfo.src

Trust, but verify

The resulting output is written to ~/.terminfo:

$ tree ~/.terminfo/
├── 61
│   ├── alacritty -> /Applications/Alacritty.app/Contents/Resources/61/alacritty
│   └── alacritty-direct -> /Applications/Alacritty.app/Contents/Resources/61/alacritty-direct
└── 74
    └── tmux-256color

Check individual definitions with infocmp -x $name.