Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've tinkered with tmux and have seen settings that would highlight the border of the active pane. This works fine for three or more panes.

However, my most common usage would be two panes side by side, and none of the border highlighting I've seen helps me tell which is active if there are only two.

What setting can I give tmux to make it clear which of two panes is focused?

share|improve this question
1  
I'm running tmux 1.8. In this version, with a single vertical split, it appears that when the leftmost pane is selected, only the top half of the vertical split line is highlighted, and when the rightmost pane is selected, only the bottom half of the vertical split line is highlighted. I believe this is a relatively new change; didn't notice it in older builds. – Trevor Powell May 14 '13 at 2:13
    
@TrevorPowell - you're right, it's new in 1.8. I couldn't find it documented in a changelog, but I upgraded from 1.6 to 1.7 to 1.8, and got the feature with 1.8. – Nathan Long Jun 28 '13 at 15:15
up vote 5 down vote accepted

Use Tmux 1.8

Starting in tmux 1.8, tmux distinguishes between a left/right active pane by only highlighting the top/bottom half of the split line.

Screenshot (iTerm2 + tmux 1.8): iTerm2 + tmux 1.8

If you must use an earlier version, none of the tmux settings appear to help in your exact case. As an alternative, you could look for the blinking shell cursor, which only appears in the active pane.

share|improve this answer
    
I noticed the split highlighting being half recently and thought it was a bug. Now that I think of it, it's great. However, I think the best solution would be change the background of active/inactive panes. – scicalculator May 23 '13 at 0:19

As of (as far as I can tell) tmux 2.1, there's a new styling option that takes care of this quite handily:

window-active-style style
    Set the style for the window's active pane.  For how to specify style, see
    the message-command-style option.

For example,

setw -g window-active-style 'bg=black'

You can use any of the standard styles, here extracted from the man tmux:

message-command-style style
    Set status line message command style, where style is a comma-separated
    list of characteristics to be specified.

    These may be `bg=colour` to set the background colour, `fg=colour` to set
    the foreground colour, and a list of attributes as specified below.

    The colour is one of: black, red, green, yellow, blue, magenta, cyan,
    white, aixterm bright variants (if supported: brightred, brightgreen, and
    so on), colour0 to colour255 from the 256-colour set, default, or a
    hexadecimal RGB string such as `#ffffff`, which chooses the closest match
    from the default 256-colour set.

    The attributes is either none or a comma-delimited list of one or more of:
    bright (or bold), dim, underscore, blink, reverse, hidden, or italics, to
    turn an attribute on, or an attribute prefixed with `no` to turn one off.

    Examples are:

        fg=yellow,bold,underscore,blink
        bg=black,fg=default,noreverse

    With the -a flag to the set-option command the new style is added
    otherwise the existing style is replaced.
share|improve this answer

Ctrl-B q

Look for the oddly colored number (red instead of blue).

This is a little bit more work than just looking at the screen, since it is interactive. But the application you're running in the terminal shouldn't notice any of your keystrokes.

share|improve this answer

This may be partially a feature of my terminal emulator (iterm2), but my cursor is only visible in the active split.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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