Skip to content

Don't glom new tabs into the _quake window - #20670

Open
Niu Shuai (niushuai1991) wants to merge 3 commits into
microsoft:mainfrom
niushuai1991:fix/quake-window-glomming
Open

Don't glom new tabs into the _quake window#20670
Niu Shuai (niushuai1991) wants to merge 3 commits into
microsoft:mainfrom
niushuai1991:fix/quake-window-glomming

Conversation

@niushuai1991

@niushuai1991 Niu Shuai (niushuai1991) commented Sep 12, 2026

Copy link
Copy Markdown

Summary of the Pull Request

When windowingBehavior is set to useExisting or useAnyExisting, new terminal instances glom into the most recently used window. Since pressing Win + ` activates the _quake window, it is almost always the most recently used one — so new tabs ended up inside the quake dropdown, where the tab row is not visible and tabs cannot be switched.

This PR restores the old semantics: the _quake window is never treated as the MRU glomming target.

References and Relevant Issues

Detailed Description of the Pull Request / Additional comments

WindowEmperor::_mostRecentWindow() gains an ignoreQuakeWindow argument:

  • glomming passes true, so _quake is skipped as a target:
    • WindowingMode::UseAnyExisting in _dispatchCommandline
    • the per-virtual-desktop MRU loop and its no-virtual-desktop fallback in _dispatchCommandlineCurrentDesktop
  • summoning passes false, so globalSummon and the notification area still summon the quake window when it is the MRU one
  • _dispatchSpecialKey also passes false, unchanged behavior when the quake window is focused
  • wt -w _quake still targets the quake window explicitly via GetWindowByName

Validation Steps Performed

All tested manually with a local build:

  1. useAnyExisting: open a regular window, summon quake via Win + ` (making it the MRU window), then launch a new instance → the new tab gloms into the regular window, not the quake window (before this change it went into the quake window)
  2. useExisting (per-virtual-desktop path): same steps, same result
  3. With only the quake window left open, launching a new instance correctly creates a new regular window instead of glomming into quake or failing
  4. wt -w _quake still creates a new tab in the quake window
  5. Win + ` still summons/dismisses the quake window repeatedly, with its session content preserved
  6. Keyboard input and shortcuts still work while the quake window is focused

PR Checklist

  • Closes New instance use Quake Mode window #20190
  • Tests added/passed
    • (no unit tests cover WindowEmperor's window-picking; validated manually per the steps above)
  • Documentation updated
    • If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated (if necessary)

When windowingBehavior is set to useExisting or useAnyExisting, new
terminal instances glom to the most recently used window. Since
pressing win+` activates the _quake window, it's almost always the
most recently used one, so new tabs ended up glomming into the _quake
window, where the tab row is not visible and tabs can't be switched.

Monarch::_getMostRecentPeasantID used to explicitly skip the _quake
window when finding a glomming target (originally added in microsoft#9956,
then parameterized in microsoft#10108 to keep summoning working), but that
exclusion was lost when the Monarch/Peasant layer was removed in
microsoft#18215.

This restores the old semantics by giving _mostRecentWindow an
ignoreQuakeWindow argument:
* glomming (useExisting / useAnyExisting) passes true, skipping _quake
* summoning the MRU window still passes false, so globalSummon and the
  notification area keep working as before
* `wt -w _quake` still targets the quake window via GetWindowByName
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Comment thread src/cascadia/WindowsTerminal/WindowEmperor.cpp Fixed
@github-actions

This comment has been minimized.

@niushuai1991

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New instance use Quake Mode window

2 participants