Skip to content
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 · 5 comments

Comments

@trevordmiller
Copy link

@trevordmiller 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
Copy link
Member

@nicm 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
Copy link
Author

@trevordmiller trevordmiller commented Apr 27, 2017

Ok thanks

@trevordmiller
Copy link
Author

@trevordmiller trevordmiller commented Apr 27, 2017

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

@tony
Copy link

@tony 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.

@lock
Copy link

@lock lock bot commented Feb 15, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants