Skip to content

main-pane default layouts not getting reasonable sizes #314

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

Open
oblitum opened this issue Nov 10, 2017 · 11 comments
Open

main-pane default layouts not getting reasonable sizes #314

oblitum opened this issue Nov 10, 2017 · 11 comments

Comments

@oblitum
Copy link

oblitum commented Nov 10, 2017

For the following session:

session_name: foo
windows:
- layout: main-vertical
  panes:
  - blank
  - blank
  - blank

The result is:

screenshot

Where the main pane is the left one, it's smaller than the others non main panes.

  • tmuxp load -d ./foo.yaml
  • tmux 2.6/2.5
  • tmuxp 1.3.5/1.3.2
  • libtmux 0.7.7/0.7.1
@tony
Copy link
Member

tony commented Nov 10, 2017

@oblitum reported this in #309/#312

#312 (comment)

#312 (comment)

I have experienced the same issue since 2.6

@oblitum oblitum changed the title main-pane layouts not getting reasonable sizes on 1.3.5 main-pane default layouts not getting reasonable sizes on 1.3.5 Nov 10, 2017
@tony
Copy link
Member

tony commented Nov 10, 2017

I'm getting this behavior with vanilla tmux

outside of tmux:

# create a fresh tmux client/server with no config
tmux -L test -f /dev/null

inside the new tmux session:

tmux setw main-pane-width 30
tmux split-window
tmux selectl main-vertical

@tony
Copy link
Member

tony commented Nov 10, 2017

@oblitum can you reproduce #314 (comment)?

I experienced the same issue as @oblitum. However, for me it began when using tmux 2.6. The main-pane-height and main-pane-width began being smaller, requiring me to make a larger value for it.

If I set to 30, it's 30 characters/cells wide.

If I set to 60, it's 60 cells wide.

I guess it's more accurate now?

However, the issue I have with this is I don't want a number of cells, I want a percentage (just like what we -p gives in splitw, but I want it to automatically adjust with selectl). Here's what I did with a main-horizontal layout to make it work via proportions: https://github.com/tony/tmux-config/blob/092ef9b/.tmux.conf#L73

bind m run-shell "tmux setw main-pane-height $(expr $(tmux display -p '#{window_height}') / 3 \* 2); tmux select-layout main-horizontal"

I guess the equivalent with main-pane-width would be:

bind m run-shell "tmux setw main-pane-width $(expr $(tmux display -p '#{window_width}') / 3 \* 2); tmux select-layout main-vertical"

Down the line: we could make it so tmuxp set main-pane-{width/height} to a percentage via the config. In fact, we could actually make the percentage persist by creating a hook on client-resized.

@oblitum
Copy link
Author

oblitum commented Nov 10, 2017

I experienced the same issue as @oblitum. However, for me it began when using tmux 2.6

I have the same behavior for the issue's test case on tmux 2.5.

Regarding the other manual width setting, I have never used those, I have only set width/height inside tmuxp's yamls. I think I do prefer the way it's working, I see no issue or change regarding this, for example, I have several yaml's where I set main-pane-width: 160, and it has always worked, and still is, as I'd expect. So, this is solely a matter of the defaults for "main layouts" being saner.

@oblitum oblitum changed the title main-pane default layouts not getting reasonable sizes on 1.3.5 main-pane default layouts not getting reasonable sizes Nov 10, 2017
@oblitum
Copy link
Author

oblitum commented Nov 10, 2017

I have just tested this on tmux 2.5, tmuxp 1.3.2. The behavior is still the same. So I think I may only have noticed this meanwhile the recent issues. I don't know at which point it ever started to behave differently than I'd expect.

Still, main-pane-width, etc, is working as it was before, so I don't expect its behavior to change.

@tony
Copy link
Member

tony commented Nov 26, 2017

@stale
Copy link

stale bot commented Jan 25, 2018

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.

This bot is used to handle issues where the issue hasn't been discussed or
has gone out of date. If an issue isn't resolved and handled in a certain
period of time, it may be closed. If you would like your issue re-opened,
please create a fresh issue with the latest, up to date information and
mention this issue in it.

@stale stale bot added the stale label Jan 25, 2018
@stale stale bot closed this as completed Feb 1, 2018
@Abdull
Copy link

Abdull commented Feb 3, 2022

Can we reopen this issue? I'm on tmux 3.1c and cannot get main-pane-width to work.

@tony tony reopened this Feb 3, 2022
@tony tony added the pinned label Feb 3, 2022
@tony
Copy link
Member

tony commented Feb 3, 2022

@Abdull Absolutely! Re-opened

@categulario
Copy link
Contributor

What about now in 1.13.1? I think it might be solved already

@denisw
Copy link

denisw commented Jan 5, 2023

Setting e.g. main-pane-width: '60%' works for me (tmuxp 1.24.0, tmux 3.3a). I would suggest making such a percentage the default value of main-pane-width / main-pane-height, to avoid the counter-intuitive behavior described in the original issue description.

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

No branches or pull requests

5 participants