* Invert `#if NET5_0` conditions so that when adding net6.0 target framework, the _new_ APIs are used.
* Use `NET5_0_OR_GREATER` instead of `NET5_0` to ensure consistent behaviour on future target frameworks.
The style parameter is actually nullable. Also, the documentation of the style parameter has been made explicit that `Style.Plain` is used when a `null` style is passed.
Adds a new extension method IAnsiConsole.WriteAnsi that writes
VT/ANSI control codes to the console. If VT/ANSI control codes are
not supported, nothing will be written.
* Moves ColorSystem from Profile to Capabilities
* Renames Tty to IsTerminal
* Adds IAnsiConsoleOutput to make output more flexible
Closes#343Closes#359Closes#369
The RegEx runtime perf was never anything noticeable - it was the startup time that was eating over a third of time during initialization.
This shaves 200ms off the startup time.
This commit also changes the behavior of ProgressContext.IsFinished.
Only tasks that have been started will be taken into consideration,
and not indeterminate tasks.
Closes#329Closes#331
This makes it possible for encoders to output better representation
of the actual objects instead of working with chopped up segments.
* IAnsiConsole.Write now takes an IRenderable instead of segments
* Calculating cell width does no longer require a render context
* Removed RenderContext.LegacyConsole
* Removed RenderContext.Encoding
* Added Capabilities.Unicode
These methods don't require a string.format call so we'll directly call the Render method without a call to string.format.
Added bonus of a a couple fewer allocations too.
Fixes some tree rendering problems where lines were not properly drawn
at some levels during some circumstances.
* Change the API back to only allow one root.
* Now uses a stack based approach to rendering instead of recursion.
* Removes the need for measuring the whole tree in advance.
Leave this up to each child to render.