[PR #14935] [MERGED] Enable tearing out tabs to create new windows #30303

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14935
Author: @zadjii-msft
Created: 2/28/2023
Status: Merged
Merged: 3/31/2023
Merged by: @DHowett

Base: mainHead: dev/migrie/oop/3/an-unexpected-party


📝 Commits (10+)

  • 40fdbc1 Hey this comment was TODOne, 29 TODOs left
  • 4db381e not totally happy with this, but I understand why. 29 TODOs left
  • 64257d8 This straight up isn't even used in main anymore, 26 TODOs left
  • 3026922 Fix the window name not updating as it changed. Added some notes, so, 26 TODOs left
  • 84e228f Start to move window restoration into the Emperor
  • dc1ae9a Starting to move these things to the right places
  • 8bb8391 move more window persist code around.
  • 0f4c4d8 It persists, but it doesn't restore yet.
  • a5a9930 Hey look I brought two windows back into existence!...
  • 6e6d14e We're getting closer to loading up the previous state, but it doesn't always work as expected

📊 Changes

19 files changed (+380 additions, -111 deletions)

View changed files

📝 src/cascadia/Remoting/Monarch.cpp (+13 -11)
📝 src/cascadia/Remoting/Monarch.h (+11 -1)
📝 src/cascadia/Remoting/Monarch.idl (+4 -1)
📝 src/cascadia/Remoting/WindowManager.cpp (+3 -2)
📝 src/cascadia/Remoting/WindowManager.h (+1 -1)
📝 src/cascadia/Remoting/WindowManager.idl (+1 -1)
📝 src/cascadia/TerminalApp/TabManagement.cpp (+2 -2)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+84 -24)
📝 src/cascadia/TerminalApp/TerminalPage.h (+15 -3)
📝 src/cascadia/TerminalApp/TerminalPage.idl (+1 -1)
📝 src/cascadia/TerminalApp/TerminalWindow.cpp (+125 -17)
📝 src/cascadia/TerminalApp/TerminalWindow.h (+7 -0)
📝 src/cascadia/TerminalApp/TerminalWindow.idl (+1 -1)
📝 src/cascadia/TerminalControl/TermControl.cpp (+0 -18)
📝 src/cascadia/UnitTests_Remoting/RemotingTests.cpp (+1 -1)
📝 src/cascadia/WindowsTerminal/AppHost.cpp (+76 -12)
📝 src/cascadia/WindowsTerminal/AppHost.h (+1 -3)
📝 src/cascadia/WindowsTerminal/WindowEmperor.cpp (+32 -11)
📝 src/cascadia/WindowsTerminal/WindowEmperor.h (+2 -1)

📄 Description

This is the last one 🎉

Summary

In the final chapter of our tale, we present a PR of great significance. It grants the power to tear tabs from their windows and create a new window where they may be dropped, one not necessarily of the Terminal sort. The dimensions of the original window are transferred to this new abode, and its placement on the screen is determined by the user's placement of the tab.
This is the last main chapter of the tear-out saga, and the dawning of the new age.

Closes #5000
Related to #1256

Detailed description

We're really leaning on the existing RequestNewWindow event that the monarch already had - honestly, most of that was so simple that it could have just been in the parent PRs. We just need to add new support for passing in a content blob of json, and making sure the Terminal always uses that over commandline args. Easy enough.

There's a bit of wackiness here in adjusting the positioning just right so that the new window appears in the right place, but it feels... pretty good all things considered. I'll grab a gif when my machine is less borked.


🔄 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/14935 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 2/28/2023 **Status:** ✅ Merged **Merged:** 3/31/2023 **Merged by:** [@DHowett](https://github.com/DHowett) **Base:** `main` ← **Head:** `dev/migrie/oop/3/an-unexpected-party` --- ### 📝 Commits (10+) - [`40fdbc1`](https://github.com/microsoft/terminal/commit/40fdbc1536b6e31f0735f79be3379ef160cbe6a3) Hey this comment was TODOne, 29 TODOs left - [`4db381e`](https://github.com/microsoft/terminal/commit/4db381e2cb25156589bc1ef395286fa74d665d98) not totally happy with this, but I understand why. 29 TODOs left - [`64257d8`](https://github.com/microsoft/terminal/commit/64257d830adf19c3487d775ebea31bb8baa3b507) This straight up isn't even used in main anymore, 26 TODOs left - [`3026922`](https://github.com/microsoft/terminal/commit/3026922e590d5b10581fac26c2708309c9c4f480) Fix the window name not updating as it changed. Added some notes, so, 26 TODOs left - [`84e228f`](https://github.com/microsoft/terminal/commit/84e228f1fecf37f9147747d37ba2ef280b23e176) Start to move window restoration into the Emperor - [`dc1ae9a`](https://github.com/microsoft/terminal/commit/dc1ae9a895fc83011f4dd846042c1f8acd7450e5) Starting to move these things to the right places - [`8bb8391`](https://github.com/microsoft/terminal/commit/8bb839113a4e2539c122e4ba97cabea65abfd77f) move more window persist code around. - [`0f4c4d8`](https://github.com/microsoft/terminal/commit/0f4c4d8eefb977e5f3c063a0f3a39d3948edb29e) It persists, but it doesn't restore yet. - [`a5a9930`](https://github.com/microsoft/terminal/commit/a5a99303540e06a9a4820cdac4a6c06bb75a357d) Hey look I brought two windows back into existence!... - [`6e6d14e`](https://github.com/microsoft/terminal/commit/6e6d14e0dcdb8adbf30282db7fc0477425175415) We're getting closer to loading up the previous state, but it doesn't always work as expected ### 📊 Changes **19 files changed** (+380 additions, -111 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/Remoting/Monarch.cpp` (+13 -11) 📝 `src/cascadia/Remoting/Monarch.h` (+11 -1) 📝 `src/cascadia/Remoting/Monarch.idl` (+4 -1) 📝 `src/cascadia/Remoting/WindowManager.cpp` (+3 -2) 📝 `src/cascadia/Remoting/WindowManager.h` (+1 -1) 📝 `src/cascadia/Remoting/WindowManager.idl` (+1 -1) 📝 `src/cascadia/TerminalApp/TabManagement.cpp` (+2 -2) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+84 -24) 📝 `src/cascadia/TerminalApp/TerminalPage.h` (+15 -3) 📝 `src/cascadia/TerminalApp/TerminalPage.idl` (+1 -1) 📝 `src/cascadia/TerminalApp/TerminalWindow.cpp` (+125 -17) 📝 `src/cascadia/TerminalApp/TerminalWindow.h` (+7 -0) 📝 `src/cascadia/TerminalApp/TerminalWindow.idl` (+1 -1) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+0 -18) 📝 `src/cascadia/UnitTests_Remoting/RemotingTests.cpp` (+1 -1) 📝 `src/cascadia/WindowsTerminal/AppHost.cpp` (+76 -12) 📝 `src/cascadia/WindowsTerminal/AppHost.h` (+1 -3) 📝 `src/cascadia/WindowsTerminal/WindowEmperor.cpp` (+32 -11) 📝 `src/cascadia/WindowsTerminal/WindowEmperor.h` (+2 -1) </details> ### 📄 Description _This is the last one 🎉_ ## Summary _In the final chapter of our tale, we present a PR of great significance. It grants the power to tear tabs from their windows and create a new window where they may be dropped, one not necessarily of the Terminal sort. The dimensions of the original window are transferred to this new abode, and its placement on the screen is determined by the user's placement of the tab._ _This is the last main chapter of the tear-out saga, and the dawning of the new age._ **Closes #5000** Related to #1256 ## Detailed description We're really leaning on the existing `RequestNewWindow` event that the monarch already had - honestly, most of that was so simple that it could have just been in the parent PRs. We just need to add new support for passing in a content blob of json, and making sure the Terminal always uses that over commandline args. Easy enough. There's a bit of wackiness here in adjusting the positioning just right so that the new window appears in the right place, but it feels... pretty good all things considered. I'll grab a gif when my machine is less borked. --- <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:39: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#30303