Skip to content

Instantly share code, notes, and snippets.

@curtismckee
Last active June 19, 2021 15:51
Show Gist options
  • Save curtismckee/9a997d10e1f031175c3c70543ccd1880 to your computer and use it in GitHub Desktop.
Save curtismckee/9a997d10e1f031175c3c70543ccd1880 to your computer and use it in GitHub Desktop.

Tmux Color Issues

TLDR

Super Helpful Gist

Reddit Comments Here

Probs dont need but..

Tmux Wiki colors stuff

Debugging

Check Terminal: echo $TERM

Check if TERM supports 256 colors: (Outputs Integer) tput colors

Check flags set for TERM: infocmp -x TERM_GOES_HERE

Use the truecolors.sh script below to test!!

I fixed the issue using the first article. But the tput colors command returned 0. The terminfo just didnt have all the correct flags set. However the output of the script clearly showed it working! 😄

#!/usr/bin/env bash
#
# Use this script to test if you have true color support in your terminal.
# Usage: ./truecolor.sh
# If the color ramp is perfectly smooth, true color is supported.
#
# Source: https://gist.github.com/XVilka/8346728
#
awk 'BEGIN{
s="/\\/\\/\\/\\/\\"; s=s s s s s s s s;
for (colnum = 0; colnum<77; colnum++) {
r = 255-(colnum*255/76);
g = (colnum*510/76);
b = (colnum*255/76);
if (g>255) g = 510-g;
printf "\033[48;2;%d;%d;%dm", r,g,b;
printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
printf "%s\033[0m", substr(s,colnum+1,1);
}
printf "\n";
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment