8

I'm setting up my tmux.conf and I want to have the activity monitor with different colors. I would like to change the color of the highlight of the alerted window in the status bar.

The problem appears when I try to change the color of the background. I'm using this options shown from the tmux manual page.

# activity window
setw -g monitor-activity on
setw -g window-status-activity-bg red
setw -g window-status-activity-fg yellow

When I reload the configuration I can see that the color of the letters in the alerted window change to red but I can't find the way to change the highlight of the alerted window.

I'm using tmux version 1.6 and I also tried unsuccessfully on version 1.8.

What I'm missing?

9

You might be running into the fact that the default window-status-activity-attr is reverse. This ends up switching the foreground and background colors (i.e. you see red letters when you specified the -bg to be red).

Try adding this:

set-window-option -g window-status-activity-attr none

Or, try adjusting or switching your window-status-activity-fg and window-status-activity-bg settings.

9
  • With this options when I change the activity-bg the color of the background changes to the desired color but then the activity-fg (color of the letters) don't change (it's always white).
    – Ionthas
    Mar 22 '14 at 8:28
  • @Ionthas: It works for me with my old copy of tmux 1.6 (and my recent master-branch compiled version) under iTerm 2. It might have something to do with the terminal emulator you are using outside of tmux, or possibly the terminfo entry you are telling tmux to use to talk to that emulator. What is your outside terminal emulator, and what TERM are you using when attaching to tmux? Mar 22 '14 at 8:39
  • I'm using iTerm2 and screen-256color. I will try to use urxvt-256color.
    – Ionthas
    Mar 22 '14 at 8:52
  • I tried with xterm-256color and I also changed my solarized theme on iterm2 to the default theme. Still not working.
    – Ionthas
    Mar 22 '14 at 9:08
  • 1
    screen-256color is appropriate for inside tmux, but you should also make sure that you are using xterm-256color outside tmux (i.e. when attaching to or creating a session). Are you sure your iTerm color configuration has not been altered (⌘I, then the Colors tab)? A command like bash -c 'for c in {0..15}; do tput setaf $c; echo colour$c; tput op; done' (out/inside tmux, with xterm-256color/screen-256color) should show you this series of colors: black, red, green, yellow, blue, magenta, cyan, and white (then the “bright” versions of these colors; solarized changes all this). Mar 22 '14 at 9:23
1

As of tmux 2.9 there is a new syntax for this:

# active window text color
set-window-option -ga window-status-activity-style fg=blue,bg=white

(Keep in mind that's backwards from what you'd expect: 'bg' is the text, 'fg' is the background.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.