
Description
Description of the new feature
The action focus-tab
with --target
takes a tab index to switch to.
But since one does not know which tab is selected or how many are present, this is only useful when one is creating ALL the tabs in a window manually.
If one knows the current tab index OR have a way to specify this instead of an index to --target
the feature would be more useful.
For example, one could spawn a tab with a long running command in the background.
Currently i have resorted to using ReadProcessMemory on a running WindowsTerminal to get at the index, not exactly ideal ;)
Proposed technical implementation details
Either --target prev
for selecting previously selected tab, or an action for wt
which only prints the current tab index wt selected-tab
.
Background spawn examples:
wt -w last new-tab "long-running-command" \; focus-tab -t prev
OR
wt -w last new-tab "long-running-command" \; focus-tab -t $(wt selected-tab)