The nextTab and prevTab actions do not work correctly when initiated via wt.exe or the command palette #13770

Closed
opened 2026-01-31 03:51:38 +00:00 by claunia · 4 comments
Owner

Originally created by @gurnec on GitHub (May 10, 2021).

Originally assigned to: @leonMSFT on GitHub.

In short, wt focus-tab --next and --previous don't do anything at all on my system, while Next tab and Previous tab via the command palette behave oddly, although I can't imagine that the latter is often used by anyone.

Windows Terminal version (or Windows build number)

1.8.1032.0

Steps to reproduce

Case 1:

Run wt -w new new-tab ; new-tab ; focus-tab --next (or --previous).

Case 2:

Run wt -w new new-tab ; new-tab.

In the new window, run wt -w 0 focus-tab --next (or --previous).

Case 3:

Run wt -w new new-tab ; new-tab ; new-tab.

In the new window, open the command palette (by default using Ctrl+Shift+P) and type in Next tab (or Previous tab) Enter.

Expected Behavior

Case 1:

The first tab is focused.

Case 2:

The first tab is focused.

Case 3:

The desired tab (according to the tabSwitcherMode) is focused.

Actual Behavior

Case 1:

The focus-tab subcommand is ignored; the second tab remains focused.

Case 2:

The focus-tab subcommand is ignored; the second tab remains focused.

Note that in the two cases above, wt focus-tab --target 0 works correctly.

Case 3:

This depends on the tabSwitcherMode:

  • mru — the desired tab is focused for a split second, and then the originally-focused tab regains focus.
  • inOrder — the desired tab is focused for a split second, and then tab index 0 gains focus.
  • disabled — the desired tab is focused (there is no bug in this case).

My apologies if I should have separated this into two issues.

Thanks!

Originally created by @gurnec on GitHub (May 10, 2021). Originally assigned to: @leonMSFT on GitHub. In short, `wt focus-tab --next` and `--previous` don't do anything at all on my system, while `Next tab` and `Previous tab` via the command palette behave oddly, although I can't imagine that the latter is often used by anyone. ### Windows Terminal version (or Windows build number) 1.8.1032.0 ### Steps to reproduce #### Case 1: Run `wt -w new new-tab ; new-tab ; focus-tab --next` (or `--previous`). #### Case 2: Run `wt -w new new-tab ; new-tab`. In the new window, run `wt -w 0 focus-tab --next` (or `--previous`). #### Case 3: Run `wt -w new new-tab ; new-tab ; new-tab`. In the new window, open the command palette (by default using <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>) and type in `Next tab` (or `Previous tab`) <kbd>Enter</kbd>. ### Expected Behavior #### Case 1: The first tab is focused. #### Case 2: The first tab is focused. #### Case 3: The desired tab (according to the `tabSwitcherMode`) is focused. ### Actual Behavior #### Case 1: The `focus-tab` subcommand is ignored; the second tab remains focused. #### Case 2: The `focus-tab` subcommand is ignored; the second tab remains focused. Note that in the two cases above, `wt focus-tab --target 0` works correctly. #### Case 3: This depends on the `tabSwitcherMode`: * `mru` — the desired tab is focused for a split second, and then the originally-focused tab regains focus. * `inOrder` — the desired tab is focused for a split second, and then tab index 0 gains focus. * `disabled` — the desired tab is focused (there is no bug in this case). ---------- My apologies if I should have separated this into two issues. Thanks!
Author
Owner

@zadjii-msft commented on GitHub (May 11, 2021):

Huh. That's certainly weird. I bet we're using the MRU order for --next and --previous, but that's almost certainly not getting updated during the initial processing of commandline actions. Great catch!

@zadjii-msft commented on GitHub (May 11, 2021): Huh. That's certainly weird. I bet we're using the MRU order for `--next` and `--previous`, but that's almost certainly not getting updated during the initial processing of commandline actions. Great catch!
Author
Owner

@DHowett commented on GitHub (May 13, 2021):

Discussion during triage: We probably shouldn't even be using MRU during focus-tab.

@DHowett commented on GitHub (May 13, 2021): Discussion during triage: We probably shouldn't even be using MRU during `focus-tab`.
Author
Owner

@Don-Vito commented on GitHub (Aug 15, 2021):

Yeah, MRU during startup makes little sense. I will issue a PR (it is few lines of code). However, I thought we need to update this in documentation and found no documentation for these flags. Am I missing something?

@Don-Vito commented on GitHub (Aug 15, 2021): Yeah, MRU during startup makes little sense. I will issue a PR (it is few lines of code). However, I thought we need to update this in documentation and found no documentation for these flags. Am I missing something?
Author
Owner

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

:tada:This issue was addressed in #10947, 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 #10947, 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#13770