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

wt.exe should support -%,--percent for setting a pane's size on the commandline #6298

Closed
Tracked by #4632
zadjii-msft opened this issue Jun 1, 2020 · 6 comments · Fixed by #8543
Closed
Tracked by #4632
Assignees
Labels
Area-Commandline wt.exe's commandline arguments 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

@zadjii-msft
Copy link
Member

See also #4632.

This was in the spec but hasn't been implemented yet. Basically just wt ; split-pane -% 30 cmd to open the Terminal with two panes, one that's 70% of the available size, and the other that's got 30%.

Or wt ; split-pane -% 30 cmd, split-pane -% 70 wsl for three panes, one with 70/30 split, and the 30 is then split into 30/70, kinda like:

+-------------------+-------+
|                   |       |
|                   |       |
|                   +-------+
|                   |       |
|                   |       |
|                   |       |
|                   |       |
|                   |       |
|                   |       |
+-------------------+-------+

@zadjii-msft zadjii-msft added Product-Terminal The new Windows Terminal. Issue-Task It's a feature request, but it doesn't really need a major design. Area-Commandline wt.exe's commandline arguments labels Jun 1, 2020
@ghost ghost added the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jun 1, 2020
@DHowett DHowett added this to the Terminal Backlog milestone Jun 2, 2020
@DHowett
Copy link
Member

DHowett commented Jun 2, 2020

Triaged onto backlog; tracked through 4632.

@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jun 2, 2020
@MagikEh
Copy link

MagikEh commented Nov 11, 2020

Likewise, when using the wt command to open multiple split-panes at once, It'd be nice to automatically balance between those as default rather than going all Fibonacci
Current Default vs Proposed:

+--------------+      +--------------+
|              |      |              |
|              |      |              |
|              |      +--------------+
|              |      |              |
+--------------+  vs  |              |
|              |      +--------------+
|              |      |              |
+--------------+      |              |
|              |      +--------------+
+--------------+      |              |
|              |      |              |
+--------------+      +--------------+

@zadjii-msft
Copy link
Member Author

@MagikEh That might be more possible once #6002 is implemented

@ghost ghost added the In-PR This issue has a related PR label Dec 10, 2020
@zadjii-msft zadjii-msft self-assigned this Dec 10, 2020
@ghost ghost closed this as completed in #8543 Dec 18, 2020
@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 18, 2020
ghost pushed a commit that referenced this issue Dec 18, 2020
## Summary of the Pull Request

Adds a `size` parameter to `splitPane`. This takes a `float`, and specifies the portion of the parent pane that should be used to create the new one. 

This also adds the param to the `split-pane` subcommand.

### Examples
 
| commandline | result |
| -- | -- |
| `wt ; sp -s .25` | ![image](https://user-images.githubusercontent.com/18356694/101784317-fb595680-3ac0-11eb-8248-782dc61957cf.png) | 
| `wt ; sp -s .8` | ![image](https://user-images.githubusercontent.com/18356694/101784442-20e66000-3ac1-11eb-8f9b-fb45a73c9334.png) |
| `wt ; sp -s .8 ; sp -H -s .3` | ![image](https://user-images.githubusercontent.com/18356694/101784552-470c0000-3ac1-11eb-9deb-df37aaa36f01.png) |

## PR Checklist
* [x] Closes #6298
* [x] I work here
* [x] Tests added/passed
* [x] Docs PR: MicrosoftDocs/terminal#208

## Detailed Description of the Pull Request / Additional comments

I went with `size`, `--size,-s` rather than `percent`, because the arg is the (0,1) version of the size, not the (0%,100%) version. 

## Validation Steps Performed

Added actions, played with the commandline, ran tests
@oising
Copy link
Collaborator

oising commented Dec 18, 2020

FYI, PowerShell uses --% as a hint to stop parsing arguments to find variable substitutions etc. I know that's not the same as single hyphen -% but just so you know.

@zadjii-msft
Copy link
Member Author

@oising That's part of the reason I actually ended up implementing this as --size,-s instead, because % is tricky like that 😝

@ghost
Copy link

ghost commented Jan 28, 2021

🎉This issue was addressed in #8543, which has now been successfully released as Windows Terminal Preview v1.6.10272.0.:tada:

Handy links:

mpela81 pushed a commit to mpela81/terminal that referenced this issue Jan 28, 2021
…osoft#8543)

## Summary of the Pull Request

Adds a `size` parameter to `splitPane`. This takes a `float`, and specifies the portion of the parent pane that should be used to create the new one. 

This also adds the param to the `split-pane` subcommand.

### Examples
 
| commandline | result |
| -- | -- |
| `wt ; sp -s .25` | ![image](https://user-images.githubusercontent.com/18356694/101784317-fb595680-3ac0-11eb-8248-782dc61957cf.png) | 
| `wt ; sp -s .8` | ![image](https://user-images.githubusercontent.com/18356694/101784442-20e66000-3ac1-11eb-8f9b-fb45a73c9334.png) |
| `wt ; sp -s .8 ; sp -H -s .3` | ![image](https://user-images.githubusercontent.com/18356694/101784552-470c0000-3ac1-11eb-9deb-df37aaa36f01.png) |

## PR Checklist
* [x] Closes microsoft#6298
* [x] I work here
* [x] Tests added/passed
* [x] Docs PR: MicrosoftDocs/terminal#208

## Detailed Description of the Pull Request / Additional comments

I went with `size`, `--size,-s` rather than `percent`, because the arg is the (0,1) version of the size, not the (0%,100%) version. 

## Validation Steps Performed

Added actions, played with the commandline, ran tests
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Commandline wt.exe's commandline arguments 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.

4 participants