Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have tmux configured to show my current working directory for each window (it gets this from bash) The problem is, sometimes the directory names get too long and it takes up a lot of space. In screen, this size used to be limited for the "non-active" windows, but in tmux it is expanded for everything.

Is there a way to limit the size of the title?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

You can probably adjust the window options window-status-format and window-status-current-format to get your desired effect.

Both of those options have the same default value (#I:#W#F: window index, a colon, window name, and window flags), so they are displayed identically by default. You could limit the length of the displayed window name of inactive windows by setting window-status-format to something like #I:#10W#F (this “maximum length” is described in the man page, under status-left).

So, in your ~/.tmux.conf, you might use this:

set-option -gw window-status-format "#I:#10W#F" # limit the length of inactive window name

Note: The above example adjusts the global value, but each window can have its own custom values since these are window options. If you end up with a some particular window that you always want to be displayed in full, then you can (re)set just that window’s window-status-format value.

share|improve this answer
    
Works perfectly, thanks! –  Naseer Apr 21 '13 at 4:44
add comment

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.