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 · 6 comments

Comments

3 participants
@lisuml
Copy link

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

nicm commented Oct 9, 2017

Detached new sessions are now always 80x24.

@nicm nicm closed this Oct 9, 2017

@lisuml

This comment has been minimized.

Copy link

lisuml commented Oct 9, 2017

Makes sense, thanks again.

@aero

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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.

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