Follow-up to: Colored text printing spaces in shell script
I have a script I wrote (with some help from @Barmar) which displays my current CPU and memory load visually. The output looks like so:
I then put the following into my
set -g status-right "#(~/load.sh)"
tmux status bars don't use ANSI escape codes, they use the same color code format as other things in tmux. You want something more like (assuming 256-color mode):
#[fg=colour28 bg=colour250]Hello World!