Tmux Session Coloring
Recently, I’ve really gotten into tmux for managing all my terminal sessions/windows. Not so much for the panes, but more for keeping a highly contextual environment per project or task.
As the number of sessions grew, they became difficult to tell apart. For a few days now, I’ve had the idea of hashing the name of the session into a unique color, so that every session had its own status-bg color.
First, the tmuxHashColor function:
1 2 3 4 5 | |
In our ns function (new session), we hash the supplied session name to a color, then use tmux send-keys to set its status-bg color to it:
1 2 3 4 5 6 7 8 9 10 | |
Now every session has it’s own distinct status-bg color!