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

Feature request: automatic splits similar to tiling window managers #3960

Closed
ericist opened this issue Dec 13, 2019 · 3 comments · Fixed by #4025
Closed

Feature request: automatic splits similar to tiling window managers #3960

ericist opened this issue Dec 13, 2019 · 3 comments · Fixed by #4025
Assignees
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@ericist
Copy link

ericist commented Dec 13, 2019

Description of the new feature/enhancement

Creating new splits could be made easier by providing a keybinding that automatically splits the currently active pane based on the current split type, similar to tiling window managers such as bspwm.

When activating the keybinding (e.g. Alt+Shift+Enter) following would happen:
If no split exists yet, the terminal would be split vertically. If a split exists and the currently active pane is part of a vertical split, it would be split horizontally and vice versa.

This is also visualized in the documentation of bspwm
Additionally, other schemes such as a spiral scheme could also be implemented

Proposed technical implementation details (optional)

The implementation could in theory be very simple: Just query the split type of the active pane
(vertical/horizontal) and create a new split of the other type when pressing the keybinding.

I would try to implement this feature myself but unfortunatley do not have the time at the moment.

@ericist ericist added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Dec 13, 2019
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Dec 13, 2019
@zadjii-msft
Copy link
Member

Okay so this sounds like two different requests here

  1. Use the current profile for creating a new split. This is already tracked by Allow the user's "open pane" bindings to open a pane with the current pane #1756, so let's direct that discussion to that thread.
  2. "automatic" or "spiral" split mode - I don't hate this. And with horizontal and vertical already being parameters for splitPane, we could totally extend that to split in automatic ways like this.

@ericist
Copy link
Author

ericist commented Dec 13, 2019

You're right, I didn't think about different profiles because I currently only use one.

Simply alternating the split types would propably be way easier to implement than
something more complex like a spiral (sometimes also called fibonacci) mode (which personally
I find not very useful anyway, I just wanted to give another example).

If this would be implemented there could also be a split ratio parameter (also found in bspwm)
which decides if a new split should split the current pane in the middle (ratio 50%) or at another point.

@zadjii-msft zadjii-msft added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Dec 15, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Dec 15, 2019
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Dec 15, 2019
@DHowett-MSFT DHowett-MSFT added Help Wanted We encourage anyone to jump in on these. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Dec 16, 2019
@ghost ghost added the In-PR This issue has a related PR label Dec 19, 2019
@zadjii-msft zadjii-msft self-assigned this Dec 19, 2019
@ghost ghost removed the Help Wanted We encourage anyone to jump in on these. label Dec 19, 2019
@ghost ghost closed this as completed in #4025 Dec 19, 2019
ghost pushed a commit that referenced this issue Dec 19, 2019
## Summary of the Pull Request

Adds support for `auto` as a potential value for a `splitPane` keybinding's `split` argument. For example:

```json
        { "keys": [ "ctrl+shift+z" ], "command": { "action": "splitPane", "profile": "matrix", "commandline": "cmd.exe", "split":"auto" } },
```

When set to `auto`, Panes will decide which direction to split based on the available space within the terminal. If the pane is wider than it is tall, the pane will introduce a new vertical split (and vice-versa).

## References

## PR Checklist
* [x] Closes #3960
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated

## Validation Steps Performed
Ran tests, played with it.
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Dec 19, 2019
@ghost
Copy link

ghost commented Jan 14, 2020

🎉This issue was addressed in #4025, which has now been successfully released as Windows Terminal Preview v0.8.10091.0.:tada:

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants