Version 1.5.3142.0: Unexpected behaviour in tab switcher with "inOrder" mode and custom nextTab/prevTab binding #11375

Closed
opened 2026-01-31 02:45:57 +00:00 by claunia · 20 comments
Owner

Originally created by @viljoviitanen on GitHub (Nov 12, 2020).

Environment

Windows build number: Microsoft Windows [Version 10.0.19042.630]
Windows Terminal version (if applicable): Windows Terminal Preview Version: 1.5.3142.0

Any other software? None that should affect this

Steps to reproduce

Set

{
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "tabSwitcherMode": "inOrder",

and custom keybindings for nextTab and prevTab, e.g.

    "actions":
    [
        { "command": "nextTab", "keys": "shift+a" },
        { "command": "prevTab", "keys": "shift+b" }
    ]

Open two tabs or more. Fiddle with the custom keybinds, keep modifier down and press e.g. a key multiple times. Compare to standard ctrl-tab or control-shift-tab bindings.

Expected behavior

Behaviour of nextTab and prevTab is the same with custom bindings as default bindings

Actual behavior

Tabs get changed seemingly randomly. E.g. with four tabs, nextTab second press (modifier kept down) gets stuck to first tab, prevTab to third tab.

Notes

This is not very important, I can personally get the behavior I want by setting tabswitcher to "disabled". Still, this is something that clearly is unexpected, or rather, wrong behavior.

Originally created by @viljoviitanen on GitHub (Nov 12, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: Microsoft Windows [Version 10.0.19042.630] Windows Terminal version (if applicable): Windows Terminal Preview Version: 1.5.3142.0 Any other software? None that should affect this ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> Set ``` { "$schema": "https://aka.ms/terminal-profiles-schema", "tabSwitcherMode": "inOrder", ``` and custom keybindings for nextTab and prevTab, e.g. ``` "actions": [ { "command": "nextTab", "keys": "shift+a" }, { "command": "prevTab", "keys": "shift+b" } ] ``` Open two tabs or more. Fiddle with the custom keybinds, keep modifier down and press e.g. a key multiple times. Compare to standard ctrl-tab or control-shift-tab bindings. # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> Behaviour of nextTab and prevTab is the same with custom bindings as default bindings # Actual behavior <!-- What's actually happening? --> Tabs get changed seemingly randomly. E.g. with four tabs, nextTab second press (modifier kept down) gets stuck to first tab, prevTab to third tab. # Notes This is not very important, I can personally get the behavior I want by setting tabswitcher to "disabled". Still, this is something that clearly is unexpected, or rather, wrong behavior.
claunia added the Needs-TriageResolution-Fix-CommittedNeeds-Tag-Fix labels 2026-01-31 02:45:57 +00:00
Author
Owner

@justinkb commented on GitHub (Nov 12, 2020):

I have the default nextTab/prevTab binding and it's not working right for me either, so probably not related to keybindings

@justinkb commented on GitHub (Nov 12, 2020): I have the default nextTab/prevTab binding and it's not working right for me either, so probably not related to keybindings
Author
Owner

@Don-Vito commented on GitHub (Nov 12, 2020):

I have the default nextTab/prevTab binding and it's not working right for me either, so probably not related to keybindings

@justinkb - are you sure you have "tabSwitcherMode": "inOrder" setting?
I am trying to reproduce the issue and it happens only with custom bindings

@Don-Vito commented on GitHub (Nov 12, 2020): > > > I have the default nextTab/prevTab binding and it's not working right for me either, so probably not related to keybindings @justinkb - are you sure you have "tabSwitcherMode": "inOrder" setting? I am trying to reproduce the issue and it happens only with custom bindings
Author
Owner

@Don-Vito commented on GitHub (Nov 12, 2020):

The problem happens for me only for custom binding and only if I continue holding shift.

In this situation we somehow call CommandPalette::SelectNextItem where no item is still selected.
Since no item is selected

  • when moving forward we get to the tab (-1 + 1) modulo size - aka first tab
  • when going backward we get to the tab -1 -1 modulo size - aka tab before the last
@Don-Vito commented on GitHub (Nov 12, 2020): The problem happens for me only for custom binding and only if I continue holding shift. In this situation we somehow call CommandPalette::SelectNextItem where no item is still selected. Since no item is selected * when moving forward we get to the tab (-1 + 1) modulo size - aka first tab * when going backward we get to the tab -1 -1 modulo size - aka tab before the last
Author
Owner

@Don-Vito commented on GitHub (Nov 12, 2020):

@zadjii-msft - it looks that there are two code paths for Ctrl+Tab and for everything else:

Ctrl + Tab is working perfectly

  • On the first tab navigation TerminalPage::_SelectNextTab resets the tab commands, and since palette is not visible selects the relevant tab index
  • On the second navigation Ctrl+Tab is intercepted by CommandPalette::_previewKeyDownHandler and everything works fine

But with custom binding things are screwed:

  • On the first tab navigation TerminalPage::_SelectNextTab resets the tab commands, and since palette is not visible selects the relevant tab index
  • On the second navigation keys are not intercepted and thus TerminalPage::_SelectNextTab is called again. It resets the commands, but now since the palette is visible we simply invoke CommandPalette::SelectNextItem. Which in turn misbehaves because no item is selected.

I am working on some fix, let's continue the discussion in the PR once it is open.

@Don-Vito commented on GitHub (Nov 12, 2020): @zadjii-msft - it looks that there are two code paths for Ctrl+Tab and for everything else: Ctrl + Tab is working perfectly * On the first tab navigation TerminalPage::_SelectNextTab resets the tab commands, and since palette is not visible selects the relevant tab index * On the second navigation Ctrl+Tab is intercepted by CommandPalette::_previewKeyDownHandler and everything works fine But with custom binding things are screwed: * On the first tab navigation TerminalPage::_SelectNextTab resets the tab commands, and since palette is not visible selects the relevant tab index * On the second navigation keys are not intercepted and thus TerminalPage::_SelectNextTab is called again. It resets the commands, but now since the palette is visible we simply invoke CommandPalette::SelectNextItem. Which in turn misbehaves because no item is selected. I am working on some fix, let's continue the discussion in the PR once it is open.
Author
Owner

@justinkb commented on GitHub (Nov 12, 2020):

I'm just using ctrl+tab, and I do have "tabSwitcherMode": "inOrder" in my settings.json, and it works only alternatingly, like with your use case. Is there any easy way I can create a quick screen cast video to demonstrate the behavior?

In any case, since the tab switcher is a regression for my workflow anyway, I'm just disabling it entirely.

@justinkb commented on GitHub (Nov 12, 2020): I'm just using ctrl+tab, and I do have "tabSwitcherMode": "inOrder" in my settings.json, and it works only alternatingly, like with your use case. Is there any easy way I can create a quick screen cast video to demonstrate the behavior? In any case, since the tab switcher is a regression for my workflow anyway, I'm just disabling it entirely.
Author
Owner

@Don-Vito commented on GitHub (Nov 12, 2020):

@justinkb - thanks for the reply! If you could create a screen capture it could really help:

  • I believe I fixed a bug with custom bindings (if the team will like my implementation), but the scenario I fixed should not happen with Ctrl+Tab.
  • I am unable to repro the scenario

To create the captures I usually use https://www.screentogif.com/ (which is free and doesn't require installation).

@Don-Vito commented on GitHub (Nov 12, 2020): @justinkb - thanks for the reply! If you could create a screen capture it could really help: * I believe I fixed a bug with custom bindings (if the team will like my implementation), but the scenario I fixed should not happen with Ctrl+Tab. * I am unable to repro the scenario To create the captures I usually use https://www.screentogif.com/ (which is free and doesn't require installation).
Author
Owner

@justinkb commented on GitHub (Nov 12, 2020):

About to go to sleep, I'll take another look at this tomorrow, or over the weekend, cheers

@justinkb commented on GitHub (Nov 12, 2020): About to go to sleep, I'll take another look at this tomorrow, or over the weekend, cheers
Author
Owner

@Don-Vito commented on GitHub (Nov 13, 2020):

@justinkb - this issue was auto-closed since the custom binding fix was merged. Yet if you have a capture for non-custom binding please attach it here or open a new ticket and I will take a look.

@Don-Vito commented on GitHub (Nov 13, 2020): @justinkb - this issue was auto-closed since the custom binding fix was merged. Yet if you have a capture for non-custom binding please attach it here or open a new ticket and I will take a look.
Author
Owner

@Tira007 commented on GitHub (Nov 13, 2020):

@Don-Vito Why do you break the tool that always worked? Just switch the tab forward - this is a hemorrhoid for 10 seconds, turn it back, another hemorrhoid for 10 seconds. We made a new function, so let people put it and enable it, leave the working version by default. How do I get it back? your "useTabSwitcher" : false , not "tabSwitcherMode" : "inOrder" do not work, as tabs switch randomly, and continue. 1.4.3141.0. With all the nerves burned.

@Tira007 commented on GitHub (Nov 13, 2020): @Don-Vito Why do you break the tool that always worked? Just switch the tab forward - this is a hemorrhoid for 10 seconds, turn it back, another hemorrhoid for 10 seconds. We made a new function, so let people put it and enable it, leave the working version by default. How do I get it back? your "useTabSwitcher" : false , not "tabSwitcherMode" : "inOrder" do not work, as tabs switch randomly, and continue. 1.4.3141.0. With all the nerves burned.
Author
Owner

@zadjii-msft commented on GitHub (Nov 13, 2020):

Hey don't throw shade at @Don-Vito, he's just a contributor who's fixed a bunch of bugs. You can throw shade at me, or anyone else in the Microsoft org, but not other external contributors

@zadjii-msft commented on GitHub (Nov 13, 2020): Hey don't throw shade at @Don-Vito, he's just a contributor who's fixed a bunch of bugs. You can throw shade at me, or anyone else in the Microsoft org, but not other external contributors
Author
Owner

@Don-Vito commented on GitHub (Nov 13, 2020):

@Don-Vito Why do you break the tool that always worked? Just switch the tab forward - this is a hemorrhoid for 10 seconds, turn it back, another hemorrhoid for 10 seconds. We made a new function, so let people put it and enable it, leave the working version by default. How do I get it back? your "useTabSwitcher" : false , not "tabSwitcherMode" : "inOrder" do not work, as tabs switch randomly, and continue. 1.4.3141.0. With all the nerves burned.

@Tira007

  1. I mentioned "tabSwitcherMode" in this post since in the original reporter used version 1.5 and mentioned this flag explicitly. I could not assume that you will try to apply techniques from 1.5 to 1.4.
  2. There were several threads from yesterday and today talking about how to revert to the original behavior in all versions. You can find some more explanation (by me) here: https://github.com/microsoft/terminal/issues/973#issuecomment-726665238
  3. I can feel your frustration when working functionality breaks, I agree that it is probably not a good idea to change the default behavior when the feature is just released, but please remember - that behind the code there are people who work really hard to deliver what community asks, and not some flawless robots with perfect decision making.
@Don-Vito commented on GitHub (Nov 13, 2020): > > > @Don-Vito Why do you break the tool that always worked? Just switch the tab forward - this is a hemorrhoid for 10 seconds, turn it back, another hemorrhoid for 10 seconds. We made a new function, so let people put it and enable it, leave the working version by default. How do I get it back? your "useTabSwitcher" : false , not "tabSwitcherMode" : "inOrder" do not work, as tabs switch randomly, and continue. 1.4.3141.0. With all the nerves burned. @Tira007 1. I mentioned `"tabSwitcherMode"` in this post since in the original reporter used version 1.5 and mentioned this flag explicitly. I could not assume that you will try to apply techniques from 1.5 to 1.4. 2. There were several threads from yesterday and today talking about how to revert to the original behavior in all versions. You can find some more explanation (by me) here: https://github.com/microsoft/terminal/issues/973#issuecomment-726665238 3. I can feel your frustration when working functionality breaks, I agree that it is probably not a good idea to change the default behavior when the feature is just released, **but** please remember - that behind the code there are people who work really hard to deliver what community asks, and not some flawless robots with perfect decision making.
Author
Owner

@Don-Vito commented on GitHub (Nov 13, 2020):

Hey don't throw shade at @Don-Vito, he's just a contributor who's fixed a bunch of bugs. You can throw shade at me, or anyone else in the Microsoft org, but not other external contributors

@zadjii-msft - few things:

  1. I am not "just a contributor" - I am your favorite one 😆
  2. By your definition, Tira can throw a shade on me as well, since I am also in Microsoft org (though work on the Terminal at nights / while eating my lunch)
@Don-Vito commented on GitHub (Nov 13, 2020): > > > Hey don't throw shade at @Don-Vito, he's just a contributor who's fixed a bunch of bugs. You can throw shade at me, or anyone else in the Microsoft org, but not other external contributors @zadjii-msft - few things: 1. I am not "just a contributor" - I am your favorite one 😆 2. By your definition, Tira can throw a shade on me as well, since I am also in Microsoft org (though work on the Terminal at nights / while eating my lunch)
Author
Owner

@Blklove commented on GitHub (Nov 13, 2020):

Pats iPhone

@Blklove commented on GitHub (Nov 13, 2020): Pats iPhone
Author
Owner

@Tira007 commented on GitHub (Nov 14, 2020):

@Don-Vito I apologize for my emotional outburst, I just tried to read the documentation, they told us how to do it, to return it, I did it, it didn't work, I went to read the comments, and who wrote what helped them, but I still couldn't work, I had to abandon terminal, and look for a new terminal to continue working. Thanks for the answer. And yes, I understand what people are behind the code, and what people are asking about the function, but probably start it correctly, describe how to enable it, and then, if everything is fine, and it is so necessary by default, enable it, and not immediately on release ... And so in the beginning I look for everything in the comments, in the documentation, looking for solutions trying to understand. But it doesn't work. All the best.

@Tira007 commented on GitHub (Nov 14, 2020): @Don-Vito I apologize for my emotional outburst, I just tried to read the documentation, they told us how to do it, to return it, I did it, it didn't work, I went to read the comments, and who wrote what helped them, but I still couldn't work, I had to abandon terminal, and look for a new terminal to continue working. Thanks for the answer. And yes, I understand what people are behind the code, and what people are asking about the function, but probably start it correctly, describe how to enable it, and then, if everything is fine, and it is so necessary by default, enable it, and not immediately on release ... And so in the beginning I look for everything in the comments, in the documentation, looking for solutions trying to understand. But it doesn't work. All the best.
Author
Owner

@Don-Vito commented on GitHub (Nov 14, 2020):

@Tira007 - we are good, I absolutely get your frustration and I totally agree that changing default behavior should be treated very carefully. I am not on the team, but I would suggest (for major use-cases at least):

  1. Don't change the default to an alternative that wasn't tested in production for one minor at least (usually one month)
  2. Upon changing defaults provide clear way to opt out (if possible - in UI)
  3. Engage with the end-users / community more: make decision making more transparent, provide heads up for upcoming changes

BTW, not sure if it was applicable in your scenario, for critical scenarios I simply pin the version, e.g., with chocolatey:

choco install microsoft-windows-terminal --version=1.3.2651.0

In any case, there is a bunch of other good terminals, that will hopefully meet your needs. Hope that one day you try this one again, as the team and the community is learning and improving.

@Don-Vito commented on GitHub (Nov 14, 2020): @Tira007 - we are good, I absolutely get your frustration and I totally agree that changing default behavior should be treated very carefully. I am not on the team, but I would suggest (for major use-cases at least): 1. Don't change the default to an alternative that wasn't tested in production for one minor at least (usually one month) 2. Upon changing defaults provide clear way to opt out (if possible - in UI) 3. Engage with the end-users / community more: make decision making more transparent, provide heads up for upcoming changes BTW, not sure if it was applicable in your scenario, for critical scenarios I simply pin the version, e.g., with chocolatey: ``` choco install microsoft-windows-terminal --version=1.3.2651.0 ``` In any case, there is a bunch of other good terminals, that will hopefully meet your needs. Hope that one day you try this one again, as the team and the community is learning and improving.
Author
Owner

@viljoviitanen commented on GitHub (Nov 14, 2020):

Don-Vito:

  1. Don't change the default to an alternative that wasn't tested in production for one minor at least (usually one month)

Indeed. In my opinion this change in tab behavior to mru by default was a not a good thing. Tabs changing is such a basic thing with tabbed terminals, changes to tab behavior should not be done without careful consideration. Anyway, I consider the tabbed interface model to copy from to be browsers - especially new Edge - so the default behavior should be the same as there, i.e. "disabled" (or in 1.4 "useTabSwitcher": false). But I guess it's way too late for this discussion, that ship already sailed.

@viljoviitanen commented on GitHub (Nov 14, 2020): Don-Vito: > 1. Don't change the default to an alternative that wasn't tested in production for one minor at least (usually one month) Indeed. In my opinion this change in tab behavior to mru by default was a not a good thing. Tabs changing is such a basic thing with tabbed terminals, changes to tab behavior should not be done without careful consideration. Anyway, I consider the tabbed interface model to copy from to be browsers - especially new Edge - so the default behavior should be the same as there, i.e. "disabled" (or in 1.4 "useTabSwitcher": false). But I guess it's way too late for this discussion, that ship already sailed.
Author
Owner

@DHowett commented on GitHub (Nov 19, 2020):

Hey everyone,

Thanks for bearing with us while we make our mistakes. I'm going to release a quick servicing update to both 1.4 and 1.5 that flips the default back to the way it's been for the past year and a half. MRU will be opt-in, and when #1564 lands it'll be easier to find than "just go your JSON settings and type in whatever magic string we tell you to." I accept that we allowed a vocal subset of our users to dictate what our default settings should be, to the detriment of the folks who've been using Terminal the longest.

If all goes to plan, these updates will go out as 1.4.3241 and 1.5.3242.

/cc @WilliamKyle @davidchisnall @zachjweiner from #8233

d

@DHowett commented on GitHub (Nov 19, 2020): Hey everyone, Thanks for bearing with us while we make our mistakes. I'm going to release a quick servicing update to both 1.4 and 1.5 that flips the default back to the way it's been for the past year and a half. MRU will be opt-in, and when #1564 lands it'll be easier to find than "just go your JSON settings and type in whatever magic string we tell you to." I accept that we allowed a vocal subset of our users to dictate what our default settings should be, to the detriment of the folks who've been using Terminal the longest. If all goes to plan, these updates will go out as 1.4.3241 and 1.5.3242. /cc @WilliamKyle @davidchisnall @zachjweiner from #8233 d
Author
Owner

@davidchisnall commented on GitHub (Nov 19, 2020):

Thanks @DHowett, great to see all of the improvements in the terminal (and happy to be running the preview version so things like this get caught before most users see them)!

@davidchisnall commented on GitHub (Nov 19, 2020): Thanks @DHowett, great to see all of the improvements in the terminal (and happy to be running the preview version so things like this get caught before most users see them)!
Author
Owner

@ghost commented on GitHub (Nov 20, 2020):

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

Handy links:

@ghost commented on GitHub (Nov 20, 2020): :tada:This issue was addressed in #8250, which has now been successfully released as `Windows Terminal v1.4.3243.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.4.3243.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Nov 20, 2020):

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

Handy links:

@ghost commented on GitHub (Nov 20, 2020): :tada:This issue was addressed in #8250, which has now been successfully released as `Windows Terminal Preview v1.5.3242.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.5.3242.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#11375