4
0
I am trying to find a way to easily toggle between light/dark solarized themes without needing to create a new terminal/tmux session. I am running mintty on a Windows machine and usually log into a Linux machine and connect to a tmux session.
Using mavnn's solarized mintty colors and seebi's solarized tmux colors, I have written some bash functions that can change the terminal colors on the fly. This is in my .bashrc:
function godark() { ~/solarized/sol.dark tmux source-file ~/tmux/tmuxcolors-dark.conf } function golight() { ~/solarized/sol.light tmux source-file ~/tmux/tmuxcolors-light.conf }
So inside of sol.dark there are instructions such as:
echo -ne '\eP\e]10;#839496\a' # Foreground -> base0 echo -ne '\eP\e]11;#002B36\a' # Background -> base03
and inside of my tmuxcolors-dark.conf I'll have things such as:
set-option -g status-bg colour235 #base02 set-option -g status-fg colour130 #yellow
This is almost working. If I do not have tmux open I can type "godark" and mintty will change to a dark theme, but if I type this in tmux, it will change my tmux status bar to the correct theme, but my terminal background does not change color. I do not really understand ANSI escape sequences so maybe I'm doing something silly here. I'd appreciate any help in getting this working!
Try starting tmux as
– harrymc – 2015-03-16T19:32:48.057tmux -2
to support 256 colors, from inside a terminal set asscreen-256color
. For more info see this article.Thanks, @harrymc. I did try this and unfortunately it did not help. From what I can tell I have 256 colors working fine, I just cannot switch between light and dark themes. – Jeff – 2015-03-17T03:13:28.287