[PR #9118] [MERGED] Add support for the windowingBehavior setting #27434

Open
opened 2026-01-31 09:21:57 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/9118
Author: @zadjii-msft
Created: 2/11/2021
Status: Merged
Merged: 2/19/2021
Merged by: @undefined

Base: mainHead: dev/migrie/f/2227-windowingBehavior


📝 Commits (10+)

  • 3bef7bb Get all the projects created and hooked up to the sln
  • 1f52d35 Yank all the M/P files, this builds?!
  • 5a9cdc8 Shockingly, this works, it works elevated, and it works unpackaged
  • 36539cf This won't work, but I'm committing this becaus I finally got it to compile a String[]
  • 27ace16 whoop, we pass the commandline from the peasant, to the monarch, and then back!
  • 9a41647 HOLY SHIT I GOT THE COMANDLINE TO EXECUTE IN THE CURRENT WINDOW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  • 5cabcfb add a note to future me
  • 03bfc6e This works as a unittest, but not a local test. That's batty
  • 590b9ff this macro makes me feel dirty
  • 0579b24 LocalTests_Remoting -> UnitTests_Remoting

📊 Changes

27 files changed (+844 additions, -84 deletions)

View changed files

📝 .github/actions/spelling/dictionary/apis.txt (+1 -0)
📝 doc/cascadia/profiles.schema.json (+10 -0)
📝 src/cascadia/Remoting/Monarch.cpp (+271 -45)
📝 src/cascadia/Remoting/Monarch.h (+8 -10)
📝 src/cascadia/Remoting/Peasant.idl (+2 -0)
📝 src/cascadia/Remoting/WindowActivatedArgs.h (+24 -1)
📝 src/cascadia/Remoting/pch.h (+6 -2)
📝 src/cascadia/TerminalApp/AppCommandlineArgs.cpp (+11 -5)
📝 src/cascadia/TerminalApp/AppCommandlineArgs.h (+2 -2)
📝 src/cascadia/TerminalApp/AppLogic.cpp (+32 -15)
📝 src/cascadia/TerminalSettingsEditor/Launch.cpp (+1 -0)
📝 src/cascadia/TerminalSettingsEditor/Launch.h (+1 -0)
📝 src/cascadia/TerminalSettingsEditor/Launch.idl (+6 -2)
📝 src/cascadia/TerminalSettingsEditor/Launch.xaml (+7 -0)
📝 src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw (+15 -0)
📝 src/cascadia/TerminalSettingsModel/EnumMappings.cpp (+1 -0)
📝 src/cascadia/TerminalSettingsModel/EnumMappings.h (+1 -0)
📝 src/cascadia/TerminalSettingsModel/EnumMappings.idl (+1 -0)
📝 src/cascadia/TerminalSettingsModel/GlobalAppSettings.cpp (+5 -0)
📝 src/cascadia/TerminalSettingsModel/GlobalAppSettings.h (+1 -0)

...and 7 more files

📄 Description

Adds support for the windowingBehavior global setting. This setting
controls how mutiple instances of wt behave in the absence of the -w
parameter. This setting has three values:

  • "useNew": (default) Multiple wt invocations (without the -w
    param) always create new windows.
  • "useAnyExisting": When starting a new wt, we'll instead default to
    any existing windows. wt -w -1 will still create new windows.
  • "useExisting": Similar to useAnyExisting, but limits to
    windows on the current desktop.

The IVirtualDesktopManager interface is very limited. Hence why we
have to track the HWNDs manually, and ask if they're on the current
desktop.

Validation Steps Performed

I've been playing with it for a week now.

References #5000
References projects/5
References #8898
Spec'd in #8135
Closes #2227
Closes https://github.com/microsoft/terminal/projects/5#card-51431448
Closes https://github.com/microsoft/terminal/projects/5#card-51431433


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/9118 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 2/11/2021 **Status:** ✅ Merged **Merged:** 2/19/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/f/2227-windowingBehavior` --- ### 📝 Commits (10+) - [`3bef7bb`](https://github.com/microsoft/terminal/commit/3bef7bbb389f7b048983bac8dda32af0e662a9fb) Get all the projects created and hooked up to the sln - [`1f52d35`](https://github.com/microsoft/terminal/commit/1f52d3583390e300b8253d605b5f79adac5e921b) Yank all the M/P files, this builds?! - [`5a9cdc8`](https://github.com/microsoft/terminal/commit/5a9cdc8b0bfda790a70368d8381559628eba554f) Shockingly, this works, it works elevated, and it works unpackaged - [`36539cf`](https://github.com/microsoft/terminal/commit/36539cfa47d1b5f3a3b0bf44f7bdcb057aa08e95) This won't work, but I'm committing this becaus I finally got it to compile a String[] - [`27ace16`](https://github.com/microsoft/terminal/commit/27ace166529367171fc81cef12aa4812e6ff8e13) whoop, we pass the commandline from the peasant, to the monarch, and then back! - [`9a41647`](https://github.com/microsoft/terminal/commit/9a41647ffe00d973f11478fb937221239d6ac81a) HOLY SHIT I GOT THE COMANDLINE TO EXECUTE IN THE CURRENT WINDOW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - [`5cabcfb`](https://github.com/microsoft/terminal/commit/5cabcfb45229f686d424c6d5a2fdfca7dd446639) add a note to future me - [`03bfc6e`](https://github.com/microsoft/terminal/commit/03bfc6e8a93c901ef00b34310c4e1c313019e720) This works as a unittest, but not a local test. That's batty - [`590b9ff`](https://github.com/microsoft/terminal/commit/590b9ff0c73487720a110213c4b19a2f4a00be8e) this macro makes me feel dirty - [`0579b24`](https://github.com/microsoft/terminal/commit/0579b2417bcdd74814ea05d7eb64723542584764) LocalTests_Remoting -> UnitTests_Remoting ### 📊 Changes **27 files changed** (+844 additions, -84 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/dictionary/apis.txt` (+1 -0) 📝 `doc/cascadia/profiles.schema.json` (+10 -0) 📝 `src/cascadia/Remoting/Monarch.cpp` (+271 -45) 📝 `src/cascadia/Remoting/Monarch.h` (+8 -10) 📝 `src/cascadia/Remoting/Peasant.idl` (+2 -0) 📝 `src/cascadia/Remoting/WindowActivatedArgs.h` (+24 -1) 📝 `src/cascadia/Remoting/pch.h` (+6 -2) 📝 `src/cascadia/TerminalApp/AppCommandlineArgs.cpp` (+11 -5) 📝 `src/cascadia/TerminalApp/AppCommandlineArgs.h` (+2 -2) 📝 `src/cascadia/TerminalApp/AppLogic.cpp` (+32 -15) 📝 `src/cascadia/TerminalSettingsEditor/Launch.cpp` (+1 -0) 📝 `src/cascadia/TerminalSettingsEditor/Launch.h` (+1 -0) 📝 `src/cascadia/TerminalSettingsEditor/Launch.idl` (+6 -2) 📝 `src/cascadia/TerminalSettingsEditor/Launch.xaml` (+7 -0) 📝 `src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw` (+15 -0) 📝 `src/cascadia/TerminalSettingsModel/EnumMappings.cpp` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/EnumMappings.h` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/EnumMappings.idl` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/GlobalAppSettings.cpp` (+5 -0) 📝 `src/cascadia/TerminalSettingsModel/GlobalAppSettings.h` (+1 -0) _...and 7 more files_ </details> ### 📄 Description Adds support for the `windowingBehavior` global setting. This setting controls how mutiple instances of `wt` behave in the absence of the `-w` parameter. This setting has three values: * `"useNew"`: (default) Multiple `wt` invocations (without the `-w` param) always create new windows. * `"useAnyExisting"`: When starting a new `wt`, we'll instead default to any existing windows. `wt -w -1` will still create new windows. * `"useExisting"`: Similar to `useAnyExisting`, but limits to windows on the current desktop. The IVirtualDesktopManager interface is _very_ limited. Hence why we have to track the HWNDs manually, and ask if they're on the current desktop. ## Validation Steps Performed I've been playing with it for a week now. References #5000 References projects/5 References #8898 Spec'd in #8135 Closes #2227 Closes https://github.com/microsoft/terminal/projects/5#card-51431448 Closes https://github.com/microsoft/terminal/projects/5#card-51431433 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:21:57 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27434