-
Notifications
You must be signed in to change notification settings - Fork 628
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
Custom layout not created correctly. #651
Comments
OS: Ubuntu 18.04.1 LTS Output of gem list:
|
I'm experiencing the exact same issue, fwiw. |
Also having this issue. |
Same issue. Ubuntu 18.04 Temporary hack: name: project
root: ~/projects/project
windows:
- editor:
layout: e414,317x86,0,0[317x63,0,0,0,317x22,0,64,2]
panes:
- $EDITOR
- tmux select-layout -t project:0 e414,317x86,0,0\[317x63,0,0,0,317x22,0,64,2\] &&
clear |
I'm experiencing the same issue. The temporary hack works, but it's ugly. Here's my config, without the hack:
The layout definitely isn't being applied. |
Same problem here:
Upper right panes are restored wrongly. |
I just had a quick look at this and it seems to be a result of tmux trying to apply that layout to the session before it's been rendered. I'll have to chew on it to figure out what the best approach is (possibly using a hook in the generated script/commands? also more than happy to hear suggestions from others!) but for now, a slightly less dirty hack than creating a bogus pane to handle the layout selection would be to use a project hook. I just tested the following using @andho's config and it seems to work consistently, but YMMV:
|
So, it turns out this is a known tmux issue. The tmuxp project (tmuxinator's Python analogue) works around the issue in a similar manner to what I'd floated above:
|
This is not strictly accurate, layouts are applied immediately even if detached (assuming the correct number of panes exist) but they will be adapted to the window size when applied and then resized as normal if the terminal is a different size when attached. Layouts are not sticky, they are applied once when select-layout is used with whatever window size tmux has at that moment. If you know the target terminal size up front you can specify it for detached sessions with -x and -y to new-session, otherwise you will get the default 80x24. Now that window size is independent of session size in 2.9+ it would be possible for tmux to resize the window to the size in the custom layout string when it is applied, but for people with the window-size option set to anything but manual (almost everyone I suspect) it would still be resized to the terminal size when attached. |
can the project reference to this in the readme under the https://github.com/tmuxinator/tmuxinator#panes section? Awesome project though, and thank you so much for putting it together and maintaining it! 😄 If you all don't mind me doing a pr I am more than happy to, let me know if I can help. |
This would be most welcome. 👍 |
So @ethagnawl is everything I talked about including ok? Like a having a quick and easy, and then having a more proper way? Or do you want me to just include the proper way? |
@elreydetoda May as well go with the "proper" way. |
I am having the same issue on ubuntu wsl on windows 10. Neither of the solutions above work for me. When I list a set of panes, apply them using the two solutions above, then run tmuxinator, all the panes are squashed upwards. See images below and my list-windows output
# /home/jmcc/.config/tmuxinator/work.yml
name: work
root: ~/PythonScripts/
windows:
- work:
layout: cd75,307x80,0,0[307x70,0,0{108x70,0,0,0,99x70,109,0[99x35,109,0,3,99x17,109,36,10,99x16,109,54,11],98x70,209,0[98x17,209,0,6,98x17,209,18,9,98x17,209,36,7,98x16,209,54,8]},307x9,0,71,1]
panes:
-
-
-
-
-
-
-
-
- I set this up manually to get the list above: This is how it looks when I run I tried both solutions with |
@jmccormac01 Does manually running If not, that is very confusing. I have no idea if/how using WSL complicates things or introduces incompatibilities, but I guess it's possible. If so, you may want to try increasing the (completely arbitrary) sleep length used in the workaround. |
It did not, I was about to try again with the longer delay and I stumbled onto another issue with WSL/tmux. The zsh shells are eating crazy amounts of CPU. I wonder if this is causing issues when setting up the layout. See microsoft/WSL#3914 . When I manually set up my layout (which I normally use on my macbook, which is annoyingly in for repair), the zsh terminals consume all my CPU. Sigh. |
I just experienced this myself. Is the hook-approach the "de-facto" hack for now? |
@KevinSjoberg I suppose so. Did you ever get a chance to add that note to the README, @elreydetoda? It should be easier to find than this thread. If not, I can do it. |
@ethagnawl I've created a pull request. See #722. |
Here is my workaround (using
Explanation:
|
putting parentheses around layout seems to do the trick for me (gentoo, tmuxinator 3.0.5):
|
I created a tmux layout and got this using list-windows:
0: bash* (4 panes) [282x71] [layout b6b8,282x71,0,0{141x71,0,0,3,140x71,142,0[140x35,142,0{70x35,142,0,5,69x35,213,0,7},140x35,142,36,6]}] @2 (active)
Then I put this in my config file:
Now when I start the project, the top-right most pane is much smaller then the original layout. So I used tmuxinator debug to get the code and tried the line that sets the layout:
tmux select-layout -t project1:0 b6b8,282x71,0,0\{141x71,0,0,3,140x71,142,0\[140x35,142,0\{70x35,142,0,5,69x35,213,0,7\},140x35,142,36,6\]\}
This fixes the layout.
This is on Ubuntu:18.04. Let me know any other info that might be needed.
The text was updated successfully, but these errors were encountered: