Compare commits

...

6 Commits

Author SHA1 Message Date
Mike Griese
0112234835 not totally sure what I touched in the powerpoint but whatever 2022-11-30 13:19:31 -06:00
Mike Griese
110889f108 hey links don't work so well, update the pptx 2022-11-29 15:08:10 -06:00
Mike Griese
32624418b2 I think this is it... 2022-11-29 12:00:10 -06:00
Mike Griese
e11604de00 Merge remote-tracking branch 'origin/main' into dev/migrie/s/5000-presentation 2022-11-29 06:57:15 -06:00
Dustin L. Howett
d212c93d08 Migrate spelling-0.0.21 changes from main 2022-11-22 15:06:55 -06:00
Mike Griese
2794acb0ea learning marp went worse than expected but this works 2022-11-22 15:06:55 -06:00
8 changed files with 279 additions and 2 deletions

View File

@@ -0,0 +1,277 @@
---
marp: true
theme: default
Title: Terminal Process Model 2.0
paginate: true
footer: 'Terminal Process Model 2.0'
---
# Terminal Process Model 2.0
### Mike Griese
_November 29, 2022_
---
<style>
div.twocols {
/* margin-top: 35px; */
/* margin-bottom: 35px; */
column-count: 2;
}
div.twocols p:first-child,
div.twocols img: { height: 70%} ,
div.twocols h1:first-child,
div.twocols h2:first-child,
div.twocols ul:first-child,
div.twocols ul li:first-child,
div.twocols ul li p:first-child {
margin-top: 0 !important;
}
div.twocols p.break {
break-before: column;
margin-top: 0;
}
</style>
<div class="twocols">
<img src="./figure-001.png" height="600px">
<p class="break"></p>
# Current Process Model
* All one process
* `Connection` talks to ConPTY (conhost), which is responsible for communicating with client apps (`cmd`, `pwsh`, `WSL`, `ssh`)
* `TermControl` is the XAML control responsible for drawing the buffer to the screen, via DX
* `App` hosts the UI of the app, including other XAML elements
</div>
---
<div class="twocols">
<img src="./figure-004.png" height="500px" >
<p class="break"></p>
# Current Process Model
* All one process
* `App` hosts the UI of the app, including other XAML elements
* Multiple tabs each host their own `TermControl`s, who talk to their own `Connection`s
</div>
---
# PROBLEM Tab tear-out & merge
![](tear-out-simple-example.png)
---
# PROBLEM Tab tear-out & merge
<div class="twocols">
### BUFFER CONTENTS
How do we move 9001x32 (or more) characters, attributes, and other properties from one process to another quickly & efficiently?
### PERFORMANCE
Any solution cannot meaningfully impact overall Terminal throughput and input responsiveness
<p class="break"></p>
### WINDOW RELIABILITY
Wed rather that crashes in one window dont end up bringing down all your Terminal windows, so we should have one top-level window per-process
### XAML ISLANDS
The Terminal is a XAML Islands application (with no path to WinUI 3 at the moment). Theres no way to have multiple XI windows in the same process currently.
</div>
---
# SOLUTION
## WINDOW AND CONTENT PROCESSES
Separate the Terminal into two types of process Window, and Content.
### Window
The process with the actual Terminal HWND and XAML UI tree.
### Content
Hosts the terminal buffer and connection to client application.
---
<div class="twocols">
<img src="./figure-002.png" height="500px" >
<p class="break"></p>
# Proposed Process Model
* Each connection / client / terminal instance lives in its own “Content Process”
* All XAML lives in a “Window Process”
* Windows host the content of multiple Content Processes
</div>
---
<div class="twocols">
<img src="./figure-003.png" height="500px" >
<p class="break"></p>
# Proposed Process Model
* Each connection / client / terminal instance lives in its own “Content Process”
* All XAML lives in a “Window Process”
* Windows host the content of multiple Content Processes
</div>
---
<div class="twocols">
<img src="./figure-005.png" height="500px" >
<p class="break"></p>
# Proposed Process Model
* Each connection / client / terminal instance lives in its own “Content Process”
* All XAML lives in a “Window Process”
* Windows host the content of multiple Content Processes
</div>
---
# Proposed Process Model
COM & WinRT is magic.
<br>
<br>
<br>
<br>
---
# Proposed Process Model
* Wed rather not roll our own IPC mechanism to communicate between Window and Content processes
* WinRT (COM) already gives us a rich set of features for defining methods, events
* WinRT can already be used x-proc
* Small<sup>[1]</sup> refactors to the `TermControl` code enabled us to create a WinRT boundary between the XAML code and the “core”
<sub> [1] _for some definition of small meaning quite large_</subs>
---
<!-- # Proposed Process Model -->
<!-- <img src="./figure-005.png" height="500px" width="600px"> -->
<div class="twocols">
<img src="./figure-005.png" height="500px" >
<p class="break"></p>
# Proposed Process Model
* Each “Content Process” has it's own GUID
* Any window can connect to a content process just by it's GUID
* To move content from one pane to another, all you need to serialize is the GUID
</div>
---
# Proposed Process Model
The content process registers itself with `CoRegisterClassObject`, like so:
```c++
CoRegisterClassObject(MyContentGUID,
winrt::make<ContentProcess>().get(),
CLSCTX_LOCAL_SERVER,
REGCLS_MULTIPLEUSE,
&dwRegistration);
```
The Window can get this _specific_ instance of `ContentProcess` with
```c++
auto content = create_instance<winrt::ContentProcess>(MyContentGUID, CLSCTX_LOCAL_SERVER);
```
---
# Drop tab on an existing window
<img src="./drop-tab-on-existing-window.png" height="500px" >
---
# PROOF OF CONCEPT
![](proof-of-concept-000.gif)
---
# Questions
Mike Griese (migrie)
[@zadjii-msft](https://github.com/zadjii-msft)
[Terminal Repo](https://github.com/microsoft/terminal)
[Original doc link](https://github.com/microsoft/terminal/blob/main/doc/specs/%235000%20-%20Process%20Model%202.0/%235000%20-%20Process%20Model%202.0.md)
[Tracking issue](https://github.com/microsoft/terminal/issues/5000)
---
# Addenda
---
<!--
# Window-Content IPC
* Wed rather not roll our own IPC mechanism to communicate between Window and Content processes
* WinRT (COM) already gives us a rich set of features for defining methods, events
* WinRT can already be used x-proc
* Small<sup>[1]</sup> refactors to the `TermControl` code enabled us to create a WinRT boundary between the XAML code and the “core”
<sub> [1] _for some definition of small meaning quite large_</subs>
---
# Serialization of a Tab?
* TODO!
* we used the existing serialization code, it was grand!
--- -->
# Terminal / Console Architecture
<img src="./terminal-console-architecture-000.png" width="800px" >
---
# Mixed Elevation
![](mixed-elevation.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
@@ -16,7 +16,7 @@
<Identity
Name="WindowsTerminalDev"
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
Publisher="CN=migrie"
Version="0.0.1.0" />
<Properties>