Conhost/Terminal supported C1 control sequences for a while... but then
that apparently caused some problems. So they disabled them by default,
which causes all our VT SGR sequences to be broken (so instead of pretty
color output, you just see gray output, with strange numbers sprinkled
all over). Fortunately they provided a way to turn them back on.
Related: https://github.com/microsoft/terminal/pull/11690
Related: https://github.com/microsoft/terminal/issues/10310
Note that I believe you need a relatively recent build for this change
to have effect.
In commit 07485ef29c, I added this as the first line of Main:
Console.OutputEncoding = Encoding.Unicode;
With the comment:
This allows "[Console]::WriteLine( [char] 0x2026 )" to work just as
well as "[char] 0x2026".
But this caused output from other programs (that weren't emitting UTF16)
to be garbled (because the output was interpreted as UTF16 when captured
into a variable) (#95).
Hopefully setting the output encoding to UTF8 will work out better. At
least it lets both "[Console]::WriteLine( [char] 0x2026 )" and "git
--version" to work.
Addresses #95.
Stuff running on the V2 CLR, and multiple desktop .NET CLRs loaded into
a process, are no longer interesting scenarios for me. I don't even know
if this stuff was working correctly.
Overhaul AnsiColorWriter to use VT sequences instead of Console API when VT support is present (huge output performance improvement from reduced context switches & associated overhead)
The xterm-style SGR push/pop control sequences conflict with C#
formatting (due to use of curly brackets), so I'm swapping the curly
brackets out for something else ('p' and 'q') for the time being.
Ideally dbgeng would never AV. But sometimes it does, and when it does,
it can be difficult to figure out what is going on. Catching them gives
us a chance, and prevents our frames from being silently ripped through.
Most of the information is already available, and the fixed-size buffer
members are really terrible (maybe impossible?) to deal with in
PowerShell, but at least some of the fields could potentially be useful.
It has never been released outside Microsoft, and has been mostly
superseded by the shipping JavaScript scripting support in the
Debugging Tools for Windows package.
* Make FormatBaseCommand.RenderScriptValue work in a moderately less hacky way
Remove CaptureContext, since it's actively broken by these changes
* RenderScriptValue: preserve errors in $error for inspection
Also tweaked the pipe index thing so the PipeIndexPSVariable.ToString()
method is no longer needed.
* Use Import-Module to capture previously bound functions
* Fix error on ln output formatting
* Remove unused PipeIndexPSVariable stuff