3

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.

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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