7

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?

1 Answer 1

9

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.

2
  • As far as I know, the #10W will not works with tmux 2.1, only the #W
    – andras.tim
    Aug 12, 2016 at 12:45
  • 4
    @andras.tim: The syntax for #10W in newer tmux versions is '#{=10:window_name}' Aug 13, 2016 at 8:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .