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

Focus the last tab when the param to focus-tab is greater than the number of tabs #9369

Closed
ngmariusz opened this issue Mar 3, 2021 · 3 comments · Fixed by #10651
Closed
Assignees
Labels
Area-Commandline wt.exe's commandline arguments good first issue This is a fix that might be easier for someone to do as a first contribution Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@ngmariusz
Copy link

From releas notes

wt can now run commands in any window that already exists with wt -w # (#8898)

    You can specify wt -w -1 to force the creation of a new window even if you've disabled it with the Windowing Behaviors

          Specifying a window that does not exist (wt -w 1048576) will result in a new window being created with that ID (!)

it's great!

but to make it actually useful it should work with same pattern for tabs so i'd to be able to

wt -w 1048576 focus-tab -t 3

and expected result is to focus tab with index 3

or create it if it not exists

so for example

if i have only one tab in this window perhaps it could fallback to

wt -w 1048576 ; ; ; focus-tab -t 3

?

@ngmariusz ngmariusz added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Mar 3, 2021
@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 Mar 3, 2021
@zadjii-msft
Copy link
Member

I'm not sure how I feel about it making enough tabs to satisfy that parameter. I feel like that's a pretty easy footgun for someone to fat finger something like wt -w 2 ft -t 23 and suddenly they've just opened 20 instances of their default profile 😬

Though, it does seem like providing a value greater than the number of tabs should probably focus the last one. So wt ft -t 9999 would definitely focus the last one*

*: Unless you're a madman running 10000 terminal tabs.

@zadjii-msft zadjii-msft added Area-Commandline wt.exe's commandline arguments good first issue This is a fix that might be easier for someone to do as a first contribution Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) 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 Mar 3, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 3, 2021
@zadjii-msft zadjii-msft added this to the Terminal v2.0 milestone Mar 3, 2021
@ngmariusz
Copy link
Author

yeah, i got you; i believe in people kinda like what you have just described :D

we should NOT auto fallback; Perhaps we could ask before: 'this tab does't exist are you sure you what to create 9998 tabs?"

..but still, i'm not sure if it stop one to answer 'yes' ;)

@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 Mar 13, 2021
@zadjii-msft zadjii-msft self-assigned this Jul 13, 2021
@zadjii-msft zadjii-msft changed the title focus-tab or create if not exists Focus the last tab when the param to focus-tab is greater than the number of tabs Jul 13, 2021
zadjii-msft added a commit that referenced this issue Jul 13, 2021
@ghost ghost added the In-PR This issue has a related PR label Jul 13, 2021
@ghost ghost closed this as completed in #10651 Jul 22, 2021
ghost pushed a commit that referenced this issue Jul 22, 2021
## Summary of the Pull Request

When we perform a `focusTab` action, we currently do nothing if the parameter was greater than the number of tabs. This PR changes that behavior. Now, `focus-tab -t 999999` will always focus the last tab, instead of silently doing nothing. 

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

## Validation Steps Performed
* [x] ran tests
* [x] validated commandline manually
@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 Jul 22, 2021
Rosefield pushed a commit to Rosefield/terminal that referenced this issue Jul 22, 2021
…t#10651)

## Summary of the Pull Request

When we perform a `focusTab` action, we currently do nothing if the parameter was greater than the number of tabs. This PR changes that behavior. Now, `focus-tab -t 999999` will always focus the last tab, instead of silently doing nothing. 

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

## Validation Steps Performed
* [x] ran tests
* [x] validated commandline manually
@ghost
Copy link

ghost commented Aug 31, 2021

🎉This issue was addressed in #10651, which has now been successfully released as Windows Terminal Preview v1.11.2421.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-Commandline wt.exe's commandline arguments good first issue This is a fix that might be easier for someone to do as a first contribution Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) 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