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.

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

1 Answer 1

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

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.