New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: allow percentage for "tmux set-window-option main-pane-height" #888

Closed
trevordmiller opened this Issue Apr 27, 2017 · 4 comments

Comments

3 participants
@trevordmiller
Copy link

trevordmiller commented Apr 27, 2017

Currently I'm using
tmux set-window-option main-pane-height 30
along with
tmux select-layout main-horizontal
to create this:

image

This works well for my main monitor but not as well on smaller screens; it would be great if I could use a percentage so that the non-main panes take up 1/3 or 33% height of the entire terminal or something.

Thank you for the great work. tmux is amazing.

@nicm

This comment has been minimized.

Copy link
Contributor

nicm commented Apr 27, 2017

You could write a script and run that instead of selectl, something like:

tmux selectl main-horizontal
Y=$(expr $(tmux display -p '#{window_height}') / 3)
tmux resizep -t:.0 -y $Y
@trevordmiller

This comment has been minimized.

Copy link

trevordmiller commented Apr 27, 2017

Ok thanks

@trevordmiller

This comment has been minimized.

Copy link

trevordmiller commented Apr 27, 2017

Worked great! Thank you. Here is the diff for anyone else that may need it:
trevordmiller/shell-scripts@8379962

@tony

This comment has been minimized.

Copy link

tony commented Nov 25, 2017

I made a script for handling this at https://github.com/tony/tmux-config/blob/5b348ee/scripts/resize-adaptable.sh. I also wrote a blog post about it at https://devel.tech/tips/n/tMuXrSz9/resize-tmux-main-panes-by-percentage/ and linked this issue up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment