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

Closed
opened 2026-01-31 03:26:46 +00:00 by claunia · 3 comments
Owner

Originally created by @ngmariusz on GitHub (Mar 3, 2021).

Originally assigned to: @zadjii-msft on GitHub.

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

?

Originally created by @ngmariusz on GitHub (Mar 3, 2021). Originally assigned to: @zadjii-msft on GitHub. 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` ?
Author
Owner

@zadjii-msft commented on GitHub (Mar 3, 2021):

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 commented on GitHub (Mar 3, 2021): 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<sup>*</sup> <sup>*</sup>: Unless you're a madman running 10000 terminal tabs.
Author
Owner

@ngmariusz commented on GitHub (Mar 4, 2021):

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' ;)

@ngmariusz commented on GitHub (Mar 4, 2021): 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' ;)
Author
Owner

@ghost commented on GitHub (Aug 31, 2021):

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

Handy links:

@ghost commented on GitHub (Aug 31, 2021): :tada:This issue was addressed in #10651, which has now been successfully released as `Windows Terminal Preview v1.11.2421.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.11.2421.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12854