Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

Say I open a terminal

$ echo $LINES
25
$ vi
:set lines?
25
:set lines=50
:!echo $LINES
50

-as I'd expect (and the terminal window resizes and everything works). But if I start tmux from a fresh (non-resized) terminal

$ tmux new -s resize_for_crying_out_loud
$ echo $LINES
25
$ vi
:set lines?
25
:set lines=50
:!echo $LINES
25

and vi is unusable because it gets confused and won't render right. I can adjust the window size with the mouse, and that gets both the :set lines? and :!echo $LINES commands to agree. Also TERM=screen-256color-it in tmux, TERM=rxvt-unicode-256color in normal terminal.

$ tmux new -s this_is_how_the_manual_says_to_resize -y 50

also doesn't work.

share|improve this question
up vote 0 down vote accepted

What I needed was to (install and) use the wmctrl program. First, open and place a terminal large enough to hold all the panes I wanted to see in tmux, then

wmctrl -l -G

to see the geometry of that terminal window, then use that geometry information in tmuxinator like so:

pre: "wmctrl -r :ACTIVE: -e [my geometry goes here]"

I still don't get why terminal vi is able to expand the window if it's opened directly from the terminal but not from within tmux, or why tmux itself apparently can't expand a window to conform to the custom layout I try to feed it, but I'm comfortable not knowing.

share|improve this answer

You must log in to answer this question.

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