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

[2.6] Window changes not reflected prior to session attach #1106

Closed
lisuml opened this issue Oct 9, 2017 · 7 comments
Closed

[2.6] Window changes not reflected prior to session attach #1106

lisuml opened this issue Oct 9, 2017 · 7 comments

Comments

@lisuml
Copy link

@lisuml lisuml commented Oct 9, 2017

tmux version:
2.6

Platform:
Linux

Short description of the problem:
When manipulating window layout of detached session, the changes are not reflected in the session. In order to have them reflected, session attach is required. That is resulting in "create pane failed: pane too small" message when trying to split window in detached session too many times.

Steps to reproduce:

  1. Create new session:
tmux new-session -d -s 'test' 'bash'
  1. Start splitting window to create new panes and layout them:
for i in {1..32}
do
  tmux split-window -t 'test' 'bash' && \
  tmux select-layout -t 'test' 'tiled'
done

This result in "create pane failed: pane too small" messages generated by iterations 17-32 of the above loop (it may wary depending on the screen size, so please change the range of the loop accordingly).

Now, when we split the 1..32 loop to two separated ones that are doing half of the iterations and have additional step between those 2 loops that attaches to the session and detaches immediately, you can see everything works just fine.

  1. Create new session:
tmux new-session -d -s 'test' 'bash'
  1. Start splitting window to create new panes and layout them:
for i in {1..16}
do
  tmux split-window -t 'test' 'bash' && \
  tmux select-layout -t 'test' 'tiled'
done
  1. Attach and detach from the 'test' session.
  2. Continue splitting:
for i in {1..16}
do
  tmux split-window -t 'test' 'bash' && \
  tmux select-layout -t 'test' 'tiled'
done

In that case everything works just fine and the panes are correctly placed.

Terminal:
termite

$TERM:
xterm

@nicm
Copy link
Member

@nicm nicm commented Oct 9, 2017

It seems more likely the session you created is too small to hold all the panes, but after you attach it is resized to be big enough. Try adding -x 2000 -y 2000 to new-session.

@lisuml
Copy link
Author

@lisuml lisuml commented Oct 9, 2017

Thanks @nicm, that did the trick!

Do you know why this behaviour has changed from 2.5? In previous version it worked without any additional parameters to the nes-session command.

@nicm
Copy link
Member

@nicm nicm commented Oct 9, 2017

Detached new sessions are now always 80x24.

@nicm nicm closed this Oct 9, 2017
@lisuml
Copy link
Author

@lisuml lisuml commented Oct 9, 2017

Makes sense, thanks again.

@aero
Copy link

@aero aero commented Oct 2, 2018

@nicm @lisuml cc @dennishafemann

I am using tmux-cssh ( https://github.com/dennishafemann/tmux-cssh )
I also encountered this problem.(MacOS tmux 2.7)

I added -x 2000 -y 2000 options at new-session command in tmux-cssh script.
and I connected 18 hosts simultaneously.

I expected this layout as I used to be

----------------------------------------------
|          |          |          |           |
|          |          |          |           |
----------------------------------------------
|          |          |          |           |
|          |          |          |           |
----------------------------------------------
|          |          |          |           |
|          |          |          |           |
----------------------------------------------
|          |          |          |           |
|          |          |          |           |
----------------------------------------------
|          |                                 |
|          |                                 |
----------------------------------------------

but I'v got the following weird layout.

----------------------------------------------
|          |          |          |           |
|          |          |          |           |
----------------------------------------------
|          |          |          |           |
|          |          |          |           |
----------------------------------------------
|          |          |          |           |
|          |          |          |           |
----------------------------------------------
|          |          |          |           |
|          |          |          |           |
----------------------------------------------
| |                                          |
| |                                          |
----------------------------------------------

Why the first terminal in the last row is so narrow ?

@aero
Copy link

@aero aero commented Oct 4, 2018

@nicm @lisuml cc @dennishafemann

I found a workaround.

Use tmux 2.5 with tmux-cssh.
I am forced to install tmux 2.5 with the following command on MacOS.
See: https://medium.com/@wpcarro/brewing-an-old-batch-of-tmux-81c0a62715f9

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/018281c9b8ec3070f38f009e337f03944a0aa5c7/Formula/tmux.rb

and execute "brew pin tmux" => "brew upgrade" will skip tmux during upgrade.
See: https://stackoverflow.com/questions/10093918/ignore-formula-on-brew-upgrade

It seems that tmux-2.8 will have these ( #1372 ) -x- -y- options.
Will it solve the problem?
Then , I think tmux-cssh needs to apply those options to tmux-cssh's new-session command.

@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