terminal/samples/ConPTY/GUIConsole
Mike Griese 3323dc5724
Auto-format our XAML files and enforce in CI (#9589)
This adds [`XamlStyler.Console`] to our solution, and calls it when we
format the code, to also format
our .xaml files. 
* `XamlStyler.Console` is a dotnet tool so it needs to be restored with
  `dotnet tool restore`
* I've added a set of rules to approximately follow [@cmaneu's XAML guidelines].
  Those guidelines also recommend things based on the code-behind, which
  this tool can't figure out, but also _don't matter that much_.
* There's an extra step to strip BOMs from the output, since Xaml Styler
  adds a BOM by default. Some had them before and others didn't. BOMs
  have been nothing but trouble though.

[`XamlStyler.Console`]: https://github.com/Xavalon/XamlStyler
[@cmaneu's XAML guidelines]: https://github.com/cmaneu/xaml-coding-guidelines
2021-03-29 17:09:38 -05:00
..
GUIConsole.ConPTY Add GUIConsole sample (#285) 2019-05-18 18:17:36 +00:00
GUIConsole.WPF Auto-format our XAML files and enforce in CI (#9589) 2021-03-29 17:09:38 -05:00
GUIConsole.sln Add GUIConsole sample (#285) 2019-05-18 18:17:36 +00:00
README.md Add GUIConsole sample (#285) 2019-05-18 18:17:36 +00:00

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, a FileStream 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.