Ability to define split layouts #2480
Replies: 9 comments
-
I converted this to a discussion to gather some more feedback and design the configuration style and so on. I'm supportive of this feature but I think it needs to be slightly better defined in the context of Ghostty before we go off and make an issue. You didn't do anything wrong, just noting my decision making process. Thanks! |
Beta Was this translation helpful? Give feedback.
-
To kickstart the discussion, I'd personally like to be able to have something like the following: A new action named
I'd also like to see some configurations for adjusting the width/height. These would be a # of columns or a
This is all largely based off of how tmux handles this. I could also see the height/width being arguments on the |
Beta Was this translation helpful? Give feedback.
-
For examples from other applications that support this type of tiling behavior:
I agree with @scnewma's suggestions, as the basic idea is one main pane and N supporting panes, with the ability to swap between layouts with a command and resize the main size. It would also be nice to see middle main pane (supporting on sides) and binary space partitioning. |
Beta Was this translation helpful? Give feedback.
-
Coming from kitty, I like the idea of setting a preferred split-pane layout. This way, I can bind a single keybind to create a new split (and I know where it's going to land). I personally use the |
Beta Was this translation helpful? Give feedback.
-
I'd also love a similar feature. Coming from kitty, that's one of the rare "missing" features for me. Personally, I tend to use 3 layouts: grid (balanced grid with each pane taking up roughly the same space), vertical and horizontal (all panes in a column/row, balanced in size). To get there, I see 2 problems with ghostty. First, the current split strategy systematically creates a new level of depth in the tree. For instance, split right twice in a new window, you get Some people want that, that's fine. But an equally valid choice would be to create new levels only as needed. In the same "split right twice" example, one could expect to get I believe this change alone would make kitty's vertical/horizontal/tall/fat layouts and most of the main+support models described above trivial to do "by hand". Regarding more complex layouts like grid, the issue is that I don't think you can't do them trivially by hand. Even with the first problem above solved to eliminate the need for the The only way I can think of to make it trivial is to have the terminal define the rules and logic of each layout ahead of time, and not have users recreate them by hand every time. In that regard, I think kitty has a decent approach. There's a And in terms of configuration / user interaction, it works really nicely. At least I don't see how to do much simpler or more efficient for the user:
For reference: https://sw.kovidgoyal.net/kitty/layouts/ |
Beta Was this translation helpful? Give feedback.
-
I've written a utility that manages specific sessions and layouts in tmux, currently working on a "driver" for zellij. Not sure yet how useful it will be but I am using the process of adding this functionality to refactor the codebase. Long story short, I'd love to be able to script ghostty to allow native layouts without needing a multiplexer like tmux or zellij. |
Beta Was this translation helpful? Give feedback.
-
another user of kitty's also related would be a way to define a "main" split and be able to move the current focused split into "main" with an action like
|
Beta Was this translation helpful? Give feedback.
-
I do something somewhat similar with Ghostty(previously Alacritty)/Tmux/Tmuxinator. It allows for preconfigured layouts/commands. ---
# name: Multi
name: Multi <%= rand(65536) %>
startup_pane: 0
windows:
- ✖:
layout: 92fd,168x42,0,0{83x42,0,0[83x13,0,0,0,83x13,0,14,1,83x14,0,28,2],84x42,84,0[84x13,84,0,3,84x13,84,14,4,84x14,84,28,5]}
panes:
- # local
- # local
- ash:
- ssh ash
- lg:
- ssh deskg
- na:
- ssh lapn
- dn:
- ssh kandarian Would be great to have something like this in Ghostty as I'm mainly using it for the layout and broadcasting commands(which can sort of be done with I'm guessing however that it would require a lot of work. Technically I can do something similar with ydotool(xdotool) but it's incredibly janky. |
Beta Was this translation helpful? Give feedback.
-
I've written a session and layout manager for tmux and I've also added experimental zellij support. You can specify pretty accurate layout configurations that go beyond what tmux offers out of the box. I borrowed the flex-box analogy from front end layout engines. It would be great to also add Ghostty as another potential multiplexer into the mix... So I'm all for a programatic interface to managing tabs and panes within Ghostty. |
Beta Was this translation helpful? Give feedback.
-
One of the features that I cannot live without with
tmux
is it's layout feature. This feature allows for panes to be automatically laid out with a given width/height.AFAICT, I cannot reproduce this behavior with Ghostty, but would really love it so that I could use ghostty without tmux.
To provide additional context for my workflow, I use tmux's
main-vertical
layout, when I add a new pane I automatically targetbottom-left
. This allows my new splits to always be outside of the "main" pane, with the height of the new panes always being evenly split (I accomplish this by "reselecting" the layout via hooks).Beta Was this translation helpful? Give feedback.
All reactions