2

I'd like to make the last selected window (the one to which :last-window takes you) to stand out visually. By default it's just marked with an inconspicuous - after the name.

Is there a way to set the attributes for last window name in the status line, like set-option window-status-current does for the current window name?

Update: Both Debian Wheezy (stable) and Ubuntu 12.04 have tmux 1.6 that lacks the necessary option. But there's a backport which is 1.9.

The solution was to upgrade.

3

I think there might be a version mis-match or something, but jasonwryan was on the right track for my purposes. I'm using tmux v1.8, and I see the following options in the man page that work:

         window-status-last-attr attributes
                 Set status line attributes for the last active window.

         window-status-last-bg colour
                 Set status line background colour for the last active window.

         window-status-last-fg colour
                 Set status line foreground colour for the last active window.

An example for your ~/.tmux.conf:

set -g window-status-last-attr bold
set -g window-status-last-fg blue

EDIT: Sure enough, these options were added for tmux v1.8. Thus, this answer is applicable for tmux versions >=1.8 only.

EDIT: Per jasonwryan, his solution is for v1.9+. After reviewing the changelog, the foo-{bg,fg,attr} commands are deprecated as of v1.9 and will be slowly phased out. Best to use jasonwryans solution if on v1.9+.

EDIT: Implemented this in the form of a pull request for the popular status line utility powerline. https://github.com/Lokaltog/powerline/pull/864. This pull request has since been merged.

  • I'm actually running 1.9_a... – jasonwryan Apr 25 '14 at 1:50
  • Both answers were equally worthy; I'm accepting the answer of the user with less rep. – 9000 Apr 25 '14 at 2:50
3

In tmux 1.9, you want the window-status-last-style option. From the manual:

window-status-last-style style
Set status line style for the last active window. For how to specify style, see the message-command-style option.

An example would be:

set -g window-status-last-style fg=yellow,bold

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.