WPF / WinUI3 control / ConPTY example (included) #19590

Open
opened 2026-01-31 06:48:09 +00:00 by claunia · 3 comments
Owner

Originally created by @mitchcapper on GitHub (Mar 27, 2023).

I am aware the ConPTY / wpf control are not yet meant for wide/production use (#6999) . I figured I would put a better example for them working together in a way other users might use it.

From some limited testing it actually works very well.

https://github.com/mitchcapper/ConPtyTermEmulator

Happy to contribute the example here but wasn't quite sure if best to do a PR and if so to where in the repo. There is an airspace issue I don't know if resolvable (some controls allow you to add children to the control itself so those appear on top of the native window.

I think the nuget package may also need restructuring as The ConPTY OpenTerminal.exe did not end up where the native code expected it.

It would be nice if there was a way to get the terminal buffer as well. If there was a select all it would be somewhat hackable with TerminalGetSelection but it doesn't look like it would be too hard to do a PR that is similar to GetSelectedText but for the whole buffer. Let me know if desired.

Originally created by @mitchcapper on GitHub (Mar 27, 2023). I am aware the ConPTY / wpf control are not yet meant for wide/production use (#6999) . I figured I would put a better example for them working together in a way other users might use it. From some limited testing it actually works very well. https://github.com/mitchcapper/ConPtyTermEmulator Happy to contribute the example here but wasn't quite sure if best to do a PR and if so to where in the repo. There is an airspace issue I don't know if resolvable (some controls allow you to add children to the control itself so those appear on top of the native window. I think the nuget package may also need restructuring as The ConPTY OpenTerminal.exe did not end up where the native code expected it. It would be nice if there was a way to get the terminal buffer as well. If there was a select all it would be somewhat hackable with TerminalGetSelection but it doesn't look like it would be too hard to do a PR that is similar to GetSelectedText but for the whole buffer. Let me know if desired.
claunia added the Issue-DocsProduct-MetaArea-WPFControl labels 2026-01-31 06:48:10 +00:00
Author
Owner

@DHowett commented on GitHub (Mar 27, 2023):

yo, this is so cool!

@DHowett commented on GitHub (Mar 27, 2023): _yo, this is so cool!_
Author
Owner

@carlos-zamora commented on GitHub (Mar 29, 2023):

Hi @mitchcapper. Thanks! This is awesome! We're going to hold off on officially* including it as a sample until we've productized ConPTY and the WPF control (i.e. releasing documentation/guidance/etc.).

We love the effort. This demonstrates there's a demand for this and validates us giving support to this. Please continue filing issues for things you encounter. All of this helps with our eventual goal to ship this to consumers.

[*] including this in our repository suggests that we'll be supporting it

@carlos-zamora commented on GitHub (Mar 29, 2023): Hi @mitchcapper. Thanks! This is awesome! We're going to hold off on officially* including it as a sample until we've productized ConPTY and the WPF control (i.e. releasing documentation/guidance/etc.). We love the effort. This demonstrates there's a demand for this and validates us giving support to this. Please continue filing issues for things you encounter. All of this helps with our eventual goal to ship this to consumers. [*] including this in our repository suggests that we'll be supporting it
Author
Owner

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

The repo I moved to: https://github.com/mitchcapper/EasyWindowsTerminalControl

it now includes a full usable control as official WPF support seems on hold, it also includes a alpha winui3 control that uses a ported HwndHost. More details in https://github.com/microsoft/terminal/issues/6999

@mitchcapper commented on GitHub (Mar 30, 2025): The repo I moved to: https://github.com/mitchcapper/EasyWindowsTerminalControl it now includes a full usable control as official WPF support seems on hold, it also includes a alpha winui3 control that uses a ported HwndHost. More details in https://github.com/microsoft/terminal/issues/6999
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19590