Skip to content

A way to get the currently selected tab index #18692

@ghost

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Commandlinewt.exe's commandline argumentsArea-RemotingCommunication layer between windows. Often for windowing behavior, quake mode, etc.Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Product-TerminalThe new Windows Terminal.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions