Productize the WPF, UWP Terminal Controls #9723

Open
opened 2026-01-31 02:02:14 +00:00 by claunia · 9 comments
Owner

Originally created by @zadjii-msft on GitHub (Jul 22, 2020).

Originally assigned to: @DHowett on GitHub.

This scenario tracks the remaining work to productize the UWP and WPF versions of the Terminal Control. These will allow 3rd-party developers to embed terminal instances in their applications. That way, external developers won't need to write their own terminals, they can just re-use the one we build in this repo.

Currently, the Windows Terminal uses the UWP version of the control. Similarly, Visual Studio embeds the WPF version.

Pre-Requisites

These tasks aren't immediately related, but will need to get done first to unblock this work

  • #5000 / #1256: I'm planning on tearing up the TermControl as a part of the window/content process model refactor. Undoubtably, this will affect the API boundary that will be exposed
  • #381: Before we ask anyone else to use us, we should probably be a better terminal emulator. The Alt buffer is an important part of that story.
  • Should we perhaps also finish the VT implementation for the TerminalCore as well? Currently the Terminal Core only implements the VT sequences that ConPTY will emit. Hypothetically, someone might be using this in a scenario where conpty isn't on the other end.

Tasks

## Tasks
- [x] Introduce abstraction layer between TermControl and TerminalCore (aka Interactivity) #6842
- [ ] Tear out the `SearchBoxControl` from the `TermControl`, so it can be its own control
- [ ] Remove the SharedShadow thing in SearchBoxControl, noted in #12913
- [ ] Finalize API boundary - Where is the real line between `TermControl` / `ControlInteractivity` / `ControlCore`?
- [ ] Re-base the WPF control on the shared `TerminalContent`.
- [ ] Package as a nuget
- [ ] Deploy to some nuget feed somewhere?
- [ ] #4572
- [x] #3337
- [ ] #13408
- [ ] https://github.com/microsoft/terminal/issues/15404
- [ ] https://github.com/microsoft/terminal/issues/6967
- [ ] https://github.com/microsoft/terminal/issues/6996
- [ ] https://github.com/microsoft/terminal/issues/5094
- [ ] Pasting is super wacky. The control shouldn't ask the app to paste to it.
- [ ] https://github.com/microsoft/terminal/issues/1304
- [ ] https://github.com/microsoft/terminal/issues/14407
- [ ] https://github.com/microsoft/terminal/issues/13681
- [ ] https://github.com/microsoft/terminal/issues/16404
  • Scenario: TerminalControl Interactivity Improvements #6106
  • starting Terminal with wt no longer returns the main window handle of the resulting window #7084
    • This is the "reparent the terminal to another HWND thread"
Originally created by @zadjii-msft on GitHub (Jul 22, 2020). Originally assigned to: @DHowett on GitHub. This scenario tracks the remaining work to productize the UWP and WPF versions of the Terminal Control. These will allow 3rd-party developers to embed terminal instances in their applications. That way, external developers won't need to write their own terminals, they can just re-use the one we build in this repo. Currently, the Windows Terminal uses the UWP version of the control. Similarly, Visual Studio embeds the WPF version. ## Pre-Requisites These tasks aren't immediately related, but will need to get done first to unblock this work * [x] #5000 / #1256: I'm planning on tearing up the TermControl as a part of the window/content process model refactor. Undoubtably, this will affect the API boundary that will be exposed * [x] #381: Before we ask anyone else to use us, we should probably be a better terminal emulator. The Alt buffer is an important part of that story. * [ ] Should we perhaps also finish the VT implementation for the `TerminalCore` as well? Currently the Terminal Core only implements the VT sequences that ConPTY will emit. Hypothetically, someone might be using this in a scenario where conpty _isn't_ on the other end. ## Tasks ```[tasklist] ## Tasks - [x] Introduce abstraction layer between TermControl and TerminalCore (aka Interactivity) #6842 - [ ] Tear out the `SearchBoxControl` from the `TermControl`, so it can be its own control - [ ] Remove the SharedShadow thing in SearchBoxControl, noted in #12913 - [ ] Finalize API boundary - Where is the real line between `TermControl` / `ControlInteractivity` / `ControlCore`? - [ ] Re-base the WPF control on the shared `TerminalContent`. - [ ] Package as a nuget - [ ] Deploy to some nuget feed somewhere? - [ ] #4572 - [x] #3337 - [ ] #13408 - [ ] https://github.com/microsoft/terminal/issues/15404 - [ ] https://github.com/microsoft/terminal/issues/6967 - [ ] https://github.com/microsoft/terminal/issues/6996 - [ ] https://github.com/microsoft/terminal/issues/5094 - [ ] Pasting is super wacky. The control shouldn't ask the app to paste to it. - [ ] https://github.com/microsoft/terminal/issues/1304 - [ ] https://github.com/microsoft/terminal/issues/14407 - [ ] https://github.com/microsoft/terminal/issues/13681 - [ ] https://github.com/microsoft/terminal/issues/16404 ``` ## related * Scenario: TerminalControl Interactivity Improvements #6106 * starting Terminal with wt no longer returns the main window handle of the resulting window #7084 - This is the "reparent the terminal to another HWND thread"
Author
Owner

@minecraftchest1 commented on GitHub (May 13, 2021):

This is something that I would like to see, especially if it was done in such a way that it could be ported to other frameworks such as avaloniaui.

@minecraftchest1 commented on GitHub (May 13, 2021): This is something that I would like to see, especially if it was done in such a way that it could be ported to other frameworks such as [avaloniaui](http://avaloniaui.net/).
Author
Owner

@OculiViridi commented on GitHub (Jul 21, 2022):

This is something that I would like to see, especially if it was done in such a way that it could be ported to other frameworks such as avaloniaui.

And maybe also in Uno Platform UI too! 😉

@OculiViridi commented on GitHub (Jul 21, 2022): > This is something that I would like to see, especially if it was done in such a way that it could be ported to other frameworks such as [avaloniaui](http://avaloniaui.net/). And maybe also in [Uno Platform UI](https://platform.uno/) too! 😉
Author
Owner

@OculiViridi commented on GitHub (Jan 10, 2024):

@zadjii-msft Any progress about those Tasks?

@OculiViridi commented on GitHub (Jan 10, 2024): @zadjii-msft Any progress about those Tasks?
Author
Owner

@zadjii-msft commented on GitHub (Jan 10, 2024):

Unfortunately nope. I think we originally slated this for late 2023, but alas, other internal priorities came in and bumped this. I think we fully intend to do this sometime SoonTM.

@zadjii-msft commented on GitHub (Jan 10, 2024): Unfortunately nope. I think we originally slated this for late 2023, but alas, other internal priorities came in and bumped this. I think we fully intend to do this sometime Soon<sup>TM</sup>.
Author
Owner

@OculiViridi commented on GitHub (Jan 10, 2024):

Soon ™️.

Love it! 😆

Anyway, I'm thinking about moving (at least for Now ™️) to a web-based terminal emulator like xterm.js (or others) and embed it within a WebView control.
Maybe you can give me suggestions about this approach?
Thanks!

@OculiViridi commented on GitHub (Jan 10, 2024): > Soon ™️. Love it! 😆 Anyway, I'm thinking about moving (at least for Now ™️) to a web-based terminal emulator like `xterm.js` (or others) and embed it within a `WebView` control. Maybe you can give me suggestions about this approach? Thanks!
Author
Owner

@Goldgom commented on GitHub (Dec 31, 2024):

End of 2024,any news about it?I am looking for a embedded terminal Control in WinUI3
I'v already tried the project https://github.com/Corillian/WindowsTerminal but it failed to work in my computer.
Or what can I do to finish this feature?

@Goldgom commented on GitHub (Dec 31, 2024): End of 2024,any news about it?I am looking for a embedded terminal Control in WinUI3 I'v already tried the project https://github.com/Corillian/WindowsTerminal but it failed to work in my computer. Or what can I do to finish this feature?
Author
Owner

@mitchcapper commented on GitHub (Dec 31, 2024):

I was able to get it fully working as a WPF control per my sample repo.

@mitchcapper commented on GitHub (Dec 31, 2024): I was able to get it fully working as a WPF control per my sample repo.
Author
Owner

@Goldgom commented on GitHub (Jan 3, 2025):

I was able to get it fully working as a WPF control per my sample repo.

What about WinUi3,my project is a fully WinUi3 project which can not embedde a WPF control in it.

@Goldgom commented on GitHub (Jan 3, 2025): > I was able to get it fully working as a WPF control per my sample repo. What about WinUi3,my project is a fully WinUi3 project which can not embedde a WPF control in it.
Author
Owner

@mitchcapper commented on GitHub (Mar 30, 2025):

@Goldgom My original example required their Terminal.WPF control so would not work on WinUI3, but I have an alpha solution as part of a sample library for peoples use.

Previously @zadjii-msft in this issue it was stated:

Nope, no progress on this front. EDIT: To clarify, this is in the Icebox, which basically means we don't expect the core team to ever have the resources to get around to this. We'd definitely accept community contributions though.

My original WPF example was a fully embeddable WPF control although wasn't really in a library form. It wasn't enough of what the Terminal team was looking for, so I went ahead and put together a bit more formal of a library:

https://github.com/mitchcapper/EasyWindowsTerminalControl

It supports WPF and has an alpha WinUI3 library. The WPF version is built on the fairly solid foundation my prior example was put together on the Windows Terminal teams WPF control and conpty build. The WinUI3 version is more hacked together, as I had to write a WPF equivalent control which has a hacky custom port of HwndHost.

The library should support both render only uses and full interactive terminal sessions in a (hopefully) easy to use setup.

In theory just add EasyWindowsTerminalControl nuget package to your project and then

<term:EasyTerminalControl StartupCommandLine="pwsh.exe" />

and you should be good to go. For more details see the project page https://github.com/mitchcapper/EasyWindowsTerminalControl

@mitchcapper commented on GitHub (Mar 30, 2025): @Goldgom My original example required their Terminal.WPF control so would not work on WinUI3, but I have an alpha solution as part of a sample library for peoples use. Previously @zadjii-msft in [this issue](https://github.com/microsoft/terminal/issues/13851#issuecomment-1884723720) it was stated: > Nope, no progress on this front. EDIT: To clarify, this is in the Icebox, which basically means we don't expect the core team to ever have the resources to get around to this. We'd definitely accept community contributions though. My original WPF example was a fully embeddable WPF control although wasn't really in a library form. It wasn't enough of what the Terminal team was looking for, so I went ahead and put together a bit more formal of a library: https://github.com/mitchcapper/EasyWindowsTerminalControl It supports WPF and has an alpha WinUI3 library. The WPF version is built on the fairly solid foundation my prior example was put together on the Windows Terminal teams WPF control and conpty build. The WinUI3 version is more hacked together, as I had to write a WPF equivalent control which has a hacky custom port of HwndHost. The library should support both render only uses and full interactive terminal sessions in a (hopefully) easy to use setup. In theory just add `EasyWindowsTerminalControl` nuget package to your project and then ```xml <term:EasyTerminalControl StartupCommandLine="pwsh.exe" /> ``` and you should be good to go. For more details see the project page https://github.com/mitchcapper/EasyWindowsTerminalControl
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9723