27582a9186
[Defapp] Use real HPCON for PTY management; Have Monarch always listen for connections ## PR Checklist * [x] Closes #9464 * [x] Related to #9475 - incomplete fix * [x] I work here. * [x] Manual test ## Detailed Description of the Pull Request / Additional comments - Sometimes peasants can't manage to accept a connection appropriately because I wrote defterm before @zadjii-msft's monarch/peasant architecture. The simple solution here is to just make the monarch always be listening for inbound connections. Then COM won't start a peasant with -Embedding just to ask the monarch where it should go. It'll just join the active window. I didn't close 9475 because it should follow monarch policies on which window to join... and it doesn't yet. - A lot of interesting things are happening because this didn't have a real HPCON. So I passed through the remaining handles (and re-GUID-ed the interface) that made it possible for me to pack the right process handles and such into an HPCON on the inbound connection and monitor that like any other ConptyConnection. This should resolve some of the process exit behaviors and signal channel things like resizing. |
||
---|---|---|
.. | ||
GUIConsole.ConPTY | ||
GUIConsole.WPF | ||
GUIConsole.sln | ||
README.md |
GUIConsole
This is an example of what the skeleton of a custom WPF console might look like.
The GUIConsole.WPF
project is a WPF application targeting .NET 4.6.1. It creates a single WPF Window
that acts as the console, and keeps the underlying console visible.
The GUIConsole.ConPTY
project is a .NET Standard 2.0 library that handles the creation of the console, and enables pseudoconsole behavior. Terminal.cs
contains the publicly visible pieces that the WPF application will interact with. Terminal.cs
exposes two things that allow reading from, and writing to, the console:
ConsoleOutStream
, aFileStream
hooked up to the pseudoconsole's output pipe. This will output VT100.WriteToPseudoConsole(string input)
, a method that will take the given string and write it to the pseudoconsole via its input pipe. This accepts VT100.