Original intention was to register Settings automatically for DI. This ran into problem when the container verifies the configuration is valid for a settings using the constructor for initialization. It tries to resolve the parameters and fails.
This removes the automatic registration and falls back ActivatorCreateInstance when no Setting is registered.
Probably something that only bothers me, but I'm in a habit of running dotnet test at the solution level. It was discovering this project as a test project even though it isn't. This produces an error complaining about not having a testhost.dll. I'm pretty sure this comes in via a props when xunit is referenced.
This attribute in the csproj marks the project explicitly as not a test project
* Moves ColorSystem from Profile to Capabilities
* Renames Tty to IsTerminal
* Adds IAnsiConsoleOutput to make output more flexible
Closes#343Closes#359Closes#369
Wanted a command to break down how Spectre views the command model. This outputs all the relevant settings in a tree. You can get a short explanation for all the commands, or a detailed explanation for all commands (there is a flag to go vice versa on the detailed view if you want)
app cli explain
app cli explain myappcommand
app cli explain -d
If an application runs on Windows 10.0.15063 or above, on a
runtime prior to net5.0, the color system detection will fail
and fall back to 8-bit color support.
The reason for this is because the behavior of
Environment.OSVersion.Version differs between runtimes. Unless you're
running on net5.0, both the major and build version components will
not reflect those in the actual Windows version.
1. Update CSI constant to include the [ character.
See ECMA-48 Section 8.3.16
https://www.ecma-international.org/wp-content/uploads/ECMA-48_5th_edition_june_1991.pdf
2. Use string interpolation, because it's easier to read
(and internally uses a StringBuilder)
3. Add ESC constant, because the AnsiBuilder needs it to create links.
4. Remove unused SGR overload.
1. Add an ED3 command to clear the scroll buffer.
This command is not in the original ANSI terminal control sequences but
was added later to XTerm to account for the fact that most modern
terminals have a scroll-buffer.
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-J.1C8A
This command is now awailable in basically
all terminals with scroll-buffers
2. Change CUP coordinates to 1, 1
The coordinates 0, 0 also worked, but strictly speaking they are outside
the available screen area and are capped to 1, 1 anyways.
This commit fixes#337
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
The 'root' variable does not exist in current context. Either should call Render(tree) or have it renamed to root. I've chosen root as it's more consistent with the examples later on.
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.