-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Split panes equally in size #6002
Comments
Love this idea. A few thoughts off the bat. We could accomplish this by adding a keybinding argument to the Getting inspiration from
I'm guessing we would have to have this same keybinding argument for Regardless, we probably need a spec for this so I'll tag it up now. |
my napkin spec was Consider creating a bunch of similar splits:
This makes sense, each takes not half the parent, but 1/Nth of the whole Then consider splitting B in the following:
We probably don't want to make A, B, D all take 33% width here (leaving C with 66% width) |
How about resolving this more generically with 2 new options - SplitHereVertically and SplitHereHorizontally based on mouse/cursor position. This would allow for maximum flexibility of pane sizing, and then the "parent resizing" becomes mandatory. |
I definitely second this suggestion, even though it looks like this original suggestion might be "waylaid" by now after a year or so. Use case here is for research, running multiple simulation, perhaps 8. That means 8 command line windows. It would be really helpful to see progress on all at the same time without switching tabs all the time, i.e. you want equally spread windows (ideally horizontally split). Shift+Alt+- etc. is great, but it's exponentially decreasing in size. Using the mouse to configure the 7 splits manually every time there is a run is not practical. Therefore you want it to automatically adjust the already existing splits to accommodate the new one, OR allow specification of number of splits, like 8, ahead of time so it knows how to split equally in one go. I'm sure this kind of simulation/research runs are not a corner case for this app, as running multiple old-fashioned command lines is the only other option, where you have auto tile etc available in native Window GUI. This actually can work well. However, if you have any other windows open other than the consoles, it messes up and doesn't work at all. |
This comment has been minimized.
This comment has been minimized.
I love this suggestion. I think it would also be useful to include this ability to equally size the panes via the command line. I'd love to have the terminal already set up how I want them to be by entering a single command. |
@nicbiggs fyi you probably don't need to wait for this to get what you want. You could just be clever with the split percentages today:
|
The problem with the percentage solution is that if you've got a dynamic
list of splits to do, it becomes a bit challenging to manage the
percentages correctly.
|
I've just been opening new windows. |
Copying a comment from @brupelo in #14604:
|
Hey guys, so, what do you think the above? I mean, don't get me wrong, the conemu syntax is quite convoluted and no syntax friendly by all means but at least it solves the general case as it allows to create any sort of layout or arrangment in terms of %. If there was a wt command covering the general case in terms of % that'd open a lot of possibilities to create full "dashboards" with 1 click. Or maybe I'm missing something and the above 3x2 layout could already be created with the current command syntax https://learn.microsoft.com/en-us/windows/terminal/command-line-arguments?tabs=windows#split-pane-command ? |
I wrote a simple script to generate split command def create_wt(n, oritation='H'):
assert oritation in ('H', 'V')
sizes = np.arange(n-1, 0, -1)/np.arange(n, 1, -1)
sizes = sizes.round(2)
cmd = 'wt ;' + ';'.join([f'sp -{oritation} -s {i}' for i in sizes])
print(cmd)
create_wt(5) wt ;sp -H -s 0.8;sp -H -s 0.75;sp -H -s 0.67;sp -H -s 0.5 |
I'd love to see some new command palette options to select This way, the pane splitting behavior does not need to be modified, and you're "just" adding new functionality. |
Hi guys, I don't why but when I've created a github issue from this repo it was created on a different one... I'm not sure why, anyway, posting in this one as it seems to be the official thread when it comes to pane splitting feature MicrosoftDocs/Console-Docs#301 @eromoe Interesting function you've created there, maybe could it be adjusted to create a more flexible layout of MxN with equally sized panes? |
Here's a quick and dirty Powershell script for creating evenly spaced pane grids that are at least 2x2: # Usage ./script.ps1 <rows> <cols>
$h = $args[0]
$w = $args[1]
Start-Process wt -ArgumentList ((";" + (1..($h-1) | % {
"sp -H -s $(1-1/($h-$_+1));mf previous;" + ((2..$w | % {
"sp -V -s $(1-1/($w-$_+2))"
}) -join ";") + ";mf down;"
}) -join "") + ((2..$w | % {"sp -V -s $(1-1/($w-$_+2))"}) -join ";")) I also have an extended script that allows for smaller grids and handles starting panes with individual commands. Hope it helps! |
I am wondering about the same layout when creating panes inside of a script, now it's a painful experience :( |
I had created a small tool to do this. By entering multi commands, the tool helps to automatically calculate balanced layout for windows terminal. |
Description of the new feature/enhancement
When splitting twice into three panes, I would like the option to split by parent equally.
Instead of:
Ideally it would be like this:
Coming from iTerm this makes much more sense to me.
When splitting vertically within a horizontal pane, it would work in the same fashion.
This could be a new shortcut that when splitting, e.g. "split horizontally and keep parent" where all children are resized when a new child is added or removed. (I don't how how it currently works internally, so I'm guessing here.)
The text was updated successfully, but these errors were encountered: