Releases: spectreconsole/spectre.console
0.55.0
This release brings new features, performance improvements, bug fixes, and some important architectural changes.
Caution
There are breaking changes in this release, so make sure you review the release notes and try things out before upgrading in production.
New Spectre.Console.Ansi Library
One of the biggest changes in this release is the introduction of
Spectre.Console.Ansi,
a new standalone library for writing ANSI escape
sequences to the terminal without taking a full dependency on Spectre.Console.
This makes it easy to add ANSI support to lightweight tools and libraries where
pulling in the full Spectre.Console package would be overkill. Spectre.Console
itself now depends on this library internally.
We've also added some nice convenience methods for the .NET Console class:
using Spectre.Console.Ansi;
Console.Markup("[yellow]Hello[/] ");
Console.MarkupLine("[blue]World[/]");
Console.Ansi(writer => writer
.BeginLink("https://spectreconsole.net", linkId: 123)
.Decoration(Decoration.Bold | Decoration.Italic)
.Foreground(Color.Yellow)
.Write("Spectre Console")
.ResetStyle()
.EndLink());Style Is Now a Struct
Style has been converted from a class to a struct, and link/URL information
has been extracted into a separate Link type. This improves allocation
performance, especially in rendering-heavy scenarios, but is a breaking change
for code that relies on reference semantics.
Progress Improvements
The Progress widget received a lot of love in this release. It now uses
TimeProvider instead of the wall clock, making it significantly easier to
write deterministic tests. ProgressTask has a new Tag property for attaching
arbitrary metadata, and you can now override the global hide-when-completed
behavior on individual tasks. Tasks can also be removed from the progress
context entirely.
Speed calculations have been improved with configurable max sampling age and
sample count, giving you more control over how responsive or smooth the speed
readout is. Speed calculations for stopped tasks have been fixed, and
indeterminate tasks no longer show a meaningless time estimate.
Prompt Enhancements
Prompts now accept a CancellationToken, making it possible to cancel a waiting
prompt programmatically. TextPrompt default values can now be edited by the
user instead of being accepted or rejected as a whole. There is also a new
option to clear the prompt line after the user provides input.
Tables and Rendering
Table body rows now support column spans, and a new minimal border style has
been added for a cleaner look. The Canvas widget gained half-block support,
which enables double the vertical resolution when rendering graphics. JsonText
now has a configurable indentation depth. Various performance improvements have
also been made to Markup instantiation and formatting.
Bug Fixes
A memory leak related to Segment has been fixed, along with
Segment.SplitLines ignoring multiple consecutive line breaks. A crash in
SegmentShape.Calculate when the lines list was empty has been resolved.
Interactive console detection when output is redirected now works correctly,
and table expand now properly respects fixed column widths. Truncation and
overflow handling for fullwidth characters has been corrected, and locking
performance on .NET 9.0+ has been improved.
Breaking Changes
This release contains several breaking changes. Please review the following
before upgrading.
Style is now a struct. Code relying on reference semantics such as null
checks or reference equality will need to be updated. Related to this, link
and URL information has moved from Style to a new Link type, so any code
that reads or writes links through Style will need to be adjusted.
Several previously obsoleted members have been removed. The Alignment property
on Calendar, Table, and Grid, as well as the Render extension method,
no longer exist. AnsiConsoleFactory has been made static and internal, so code
that instantiated this class directly will need an alternative approach.
Finally, ANSI output is now disabled when stdout or stderr is redirected. This
is a behavior change: output that previously included ANSI escape codes when
piped or redirected will now be plain text.
What's Changed
- Add Polyfill package by @patriksvensson in #1956
- Update dependencies by @patriksvensson in #1959
- Modernization of the code base by @patriksvensson in #1993
- Add source generation for colors, emojis and spinners by @phil-scott-78 in #1995
- Revert commits related to modernization of code by @patriksvensson in #1999
- Add half-block support to Canvas by @patriksvensson in #2002
- Modernize and clean up the code base a bit by @patriksvensson in #2004
- Add benchmarks for rendering by @patriksvensson in #2007
- Add Spectre.Console.Ansi Project by @patriksvensson in #2006
- Separate links from
Styleby @patriksvensson in #2013 - Remove obsoleted members by @patriksvensson in #2017
- chore: Update dotnet monorepo by @renovate[bot] in #2018
- Fix SplitOverflow with fullwidth characters by @bijesh-bits in #2009
- Fix expand respecting fixed table column widths by @bijesh-bits in #2010
- Use TimeProvider for Progress by @patriksvensson in #2021
- chore: Update dependency Microsoft.Bcl.TimeProvider to v10 by @renovate[bot] in #2023
- docs: fix typo SRG → SGR in README files by @bijesh-bits in #1998
- Added column spanning support for table body rows (#24) by @thomastv in #2020
- chore: Update dependency Polyfill to 9.10.0 by @renovate[bot] in #2024
- chore: Update dependency Microsoft.NET.Test.Sdk to 18.3.0 by @renovate[bot] in #2026
- chore: Update dependency Polyfill to 9.11.0 by @renovate[bot] in #2027
- Various optimisations to Markup instantiation & formatting by @benbryant0 in #2008
- Add option to clear TextPrompt after input by @ThePCJakub in #1979
- Progressbar tag support v2 pr by @mitchcapper in #2025
- chore: Update dependency Polyfill to 9.12.0 by @renovate[bot] in #2030
- chore: Update actions/upload-artifact action to v7 by @renovate[bot] in #2031
- chore: Update dependency Polyfill to 9.13.0 by @renovate[bot] in #2032
- Fix crash in SegmentShape.Calculate when lines list is empty by @rodrigomfvn in #2036
- chore: Update dependency Polyfill to 9.15.0 by @renovate[bot] in #2037
- Feature/cancel prompt by @red-stronghold in #2028
- Improve locking performance on .NET 9.0+ by @MarkCiliaVincenti in #1991
- chore: Update dependency Polyfill to 9.17.0 by @renovate[bot] in #2038
- Text prompt editable default by @MapelSiroup in #2016
- chore: Update dependency Polyfill to 9.18.0 by @renovate[bot] in #2039
- chore: Update dependency Microsoft.CodeAnalysis.Analyzers to v5 by @renovate[bot] in #2041
- chore: Update dotnet monorepo by @renovate[bot] in #2040
- chore: Update dotnet monorepo by @renovate[bot] in #2043
- Fix interactive console detection when output is redirected (#1810) by @1PetarVujakovic in #2042
- Add minimal table style by @patriksvensson in #2045
- Fix memory leak bug related to Segment by @patriksvensson in #2046
- Add setting for JSON indentation by @patriksvensson in #2048
- Disable ANSI when stdout or stderr is redirected by @1PetarVujakovic in #2047
- chore: Update dependency Polyfill to 9.20.0 by @renovate[bot] in #2049
- chore: Update dependency Polyfill to 9.21.0 by @renovate[bot] in #2...
0.53.1 (hotfix)
This is a hotfix release for 0.53.0, which accidentally included OpenCli.Sources as a dependency, instead of being included in the package.
As a bonus, a fix for panels was also included in this release 😄
What's Changed
- Ensure OpenCli.Sources are not a dependency of the CLI package. by @patriksvensson in d61788d
- Normalizes paths when writing exceptions to the console for tests. by @phil-scott-78 in #1758
- Fixes issue with Panel not applying overflow to children by @phil-scott-78 in #1942
Full Changelog: 0.53.0...0.53.1
0.54.0
Version 0.54.0 of Spectre.Console has been released!
Spectre.Console.Cli has a new home!
We've decided to move Spectre.Console.Cli to its own repository, where we will prepare it for a 1.0 release. This means that the Spectre.Console.Cli NuGet packages will no longer be versioned together with Spectre.Console. They will now have a preview version such as 1.0.0-alpha-0.x.
There should be no issues staying on version 0.53.0 of Spectre.Console.Cli until we release a stable version if you prefer not to use a pre-release dependency.
New unit testing package for Spectre.Console.Cli
There is now a new testing package for Spectre.Console.Cli called Spectre.Console.Cli.Testing. This is where you will find the CommandAppTester from now on.
You can find more information about unit testing in the documentation.
What's Changed
- Normalizes paths when writing exceptions to the console for tests. by @phil-scott-78 in #1758
- Fixes issue with Panel not applying overflow to children by @phil-scott-78 in #1942
- Remove Spectre.Console.Cli from repository by @patriksvensson in #1928
Full Changelog: 0.53.0...0.54.0
0.53.0
0.52.0
What's Changed
- Add OpenCLI integration to Spectre.Console.Cli by @patriksvensson in #1909
- Fix OPENCLI_VISIBILITY_INTERNAL to DefineConstants concat by @devlead in #1912
Full Changelog: 0.51.1...0.52.0
0.51.1
What's Changed
- Fix IndexOutOfRangeException in ExceptionFormatter by @martincostello in #1800
- TestConsole can now be configured and accessed in CommandAppTester by @magiino in #1803
- Add ShowRowSeparators in Table Widget docs by @bartoginski in #1807
- Add support for required options by @patriksvensson in #1825
- Added documentation for align widget by @Elementttto in #1746
- Fixed link not displayed in markup in Style.cs and added unit test cases by @Elementttto in #1750
- Update System.Memory dependency by @WeihanLi in #1832
- Reduce memory usage for rune width cache. by @Pannoniae in #1756
- Fix resizing of Live views with reduced size. by @belucha in #1840
- Corrects comment for optional text prompt by @aljanabim in #1857
- Update spinners by @FroggieFrog in #1873
- Support J and K for navigating list prompts by @tobias-tengler in #1877
- Fix space triggering selection when items in the selection list have a space. by @mitchdenny in #1881
- Fix bug setting Header by @mattfennerom in #1890
New Contributors
- @magiino made their first contribution in #1803
- @bartoginski made their first contribution in #1807
- @Elementttto made their first contribution in #1746
- @WeihanLi made their first contribution in #1832
- @Pannoniae made their first contribution in #1756
- @belucha made their first contribution in #1840
- @aljanabim made their first contribution in #1857
- @FroggieFrog made their first contribution in #1873
- @tobias-tengler made their first contribution in #1877
- @mitchdenny made their first contribution in #1881
- @mattfennerom made their first contribution in #1890
Full Changelog: 0.50.0...0.51.1
0.50.0
What's Changed
General
- Strong name the assemblies by @KirillOsenkov in #1623
- Update MSDN link to learn.microsoft.com by @Kissaki in #1575
- Add spanish translation for help strings by @kzu in #1597
- Update documentation: add example for the Text Prompt usage by @davide-pi in #1636
- Fix typos xml docs by @devlead in #1684
- Upgrade SixLabors.ImageSharp to 3.1.7 by @Moustafaa91 in #1779
Console
- AOT Support for Spectre.Console by @phil-scott-78 in #1690
- Make method reference to Markup.Escape more obvious by @Kissaki in #1574
- Fix
HtmlEncoderIncorrectly Applying Italics to Bold Text by @z4ryy in #1590 - Fix Console Display Issue with Deleting Wide Characters by @TonWin618 in #1595
- Fix search bug in prompt related to custom item types by @patriksvensson in #1627
- Cleanup the prompt tests by @0xced in #1635
- Add custom style for each calendar event by @davide-pi in #1246
- Fix tree expansion bug by @davide-pi in #1245
- Enhance the style of the checkboxes for multi-selection by @davide-pi in #1244
- Improve exception if a (multi)selection prompt is used incorrectly by @0xced in #1637
- Fix incorrect panel height calculation in complex layout by @BlazeFace in #1514
- Adding Enricher for Azure Pipelines by @BlazeFace in #1675
- Added hex color conversion by @jsheely in #1432
- Fixed type in Segment description by @PascalSenn in #1687
- Adding TransferSpeedColumn configuration to display bits/bytes + binary/decimal prefixes by @tpill90 in #904
- Changes Emoji dictionary to OrdinalIgnoreCase for performance by @phil-scott-78 in #1691
- ProgressTask.GetPercentage() returns 100 when max value is 0 by @FrankRay78 in #1694
- Async overloads for AnsiConsole Prompt/Ask/Confirm. by @tmds in #1194
- Support 3-digit hex codes in markup by @TheMarteh in #1708
- Add async spinner extension methods and related documentation by @phil-scott-78 in #1747
- Fix generic exception formatting by @0xced in #1755
CLI
- Remove redundant explain settings ctor by @gitfool in #1534
- Trim trailing comma in settings by @devlead in #1550
- Consider -? as an alias to -h by @kzu in #1552
- Trimming of TestConsole output by CommandAppTester is user configurable. by @FrankRay78 in #1739
- Include resource files for additional cultures in HelpProvider. by @Tolitech in #1717
- Conditionally trim trailing periods of argument and option descriptions by @TheTonttu in #1740
- Changed IConfigurator to return IConfigurator instead of void by @byte2pixel in #1762
- Add parsed unknown flag to remaining arguments for a branch with a default command by @FrankRay78 in #1660
- Correctly show application version; execution of command with version option by @FrankRay78 in #1663
- Help output correctly decides when to show the version option by @FrankRay78 in #1664
New Contributors
- @Kissaki made their first contribution in #1575
- @z4ryy made their first contribution in #1590
- @TonWin618 made their first contribution in #1595
- @KirillOsenkov made their first contribution in #1623
- @davide-pi made their first contribution in #1246
- @armanossiloko made their first contribution in #1668
- @PascalSenn made their first contribution in #1687
- @tpill90 made their first contribution in #904
- @tmds made their first contribution in #1194
- @TheMarteh made their first contribution in #1708
- @Tolitech made their first contribution in #1717
- @TheTonttu made their first contribution in #1740
- @byte2pixel made their first contribution in #1762
- @Moustafaa91 made their first contribution in #1779
Full Changelog: 0.49.1...0.50.0
0.49.0
What's Changed
- Cleanup line endings by @nils-a in #1381
- Added Spectre.Console.Cli to quick-start. by @nils-a in #1413
- Fix rendering of ListPrompt for odd pageSizes by @nils-a in #1365
- Remove mandelbrot example due to conflicting license by @patriksvensson in #1426
- Allow specifying a property to ignore the use of build-time packages for versioning and analysis by @baronfel in #1425
- Add the possibility to register multiple interceptors by @nils-a in #1412
- Added the ITypeResolver to the ExceptionHandler by @nils-a in #1411
- Updated typo in CommandApp.md by @DarqueWarrior in #1431
- Command with -v displays app version instead of executing the command by @FrankRay78 in #1427
- HelpProvider colors should be configurable by @FrankRay78 in #1408
- Direct contributors to the current CONTRIBUTING.md by @tonycknight in #1435
- Fix deadlock when cancelling prompts by @caesay in #1439
- Add progress bar value formatter by @jsheely in #1414
- Update dependencies and do some clean-up by @patriksvensson in #1440
- Delete [UsesVerify], which has become obsolete through the latest update. by @danielcweber in #1456
- Don't erase secret prompt text upon backspace when mask is null by @danielcweber in #1458
- Update dependencies to the latest version by @patriksvensson in #1459
- Automatically register command settings by @patriksvensson in #1463
- Remove [DebuggerDisplay] from Paragraph by @martincostello in #1477
- Selection Prompt Search by @slang25 in #1289
- Update dependency SixLabors.ImageSharp to v3.1.3 by @renovate in #1486
- Positioned Progress Tasks - Before or After Other Tasks by @thomhurst in #1250
- Added NoStackTrace to ExceptionFormats by @gerardog in #1489
- Pipe character for listing options (issue 1434) by @FrankRay78 in #1498
- Improve XmlDoc output by @yenneferofvengerberg in #1503
- Revert 71a5d83 to undo flickering regression by @phil-scott-78 in #1504
- AddDelegate uses an abstract type when used in a branch by @BlazeFace in #1509
- Missing Separator When Headers are Hidden by @BlazeFace in #1513
- Expose raw arguments on the command context by @patriksvensson in #1523
- Add token representation to remaining arguments by @patriksvensson in #1525
New Contributors
- @baronfel made their first contribution in #1425
- @DarqueWarrior made their first contribution in #1431
- @tonycknight made their first contribution in #1435
- @caesay made their first contribution in #1439
- @jsheely made their first contribution in #1414
- @danielcweber made their first contribution in #1456
- @martincostello made their first contribution in #1477
- @slang25 made their first contribution in #1289
- @thomhurst made their first contribution in #1250
- @gerardog made their first contribution in #1489
- @yenneferofvengerberg made their first contribution in #1503
- @BlazeFace made their first contribution in #1509
Full Changelog: 0.48.0...0.49.0
0.48.0
Version 0.48 of Spectre.Console has been released!
Several rendering issues have been addressed, such as fixing problems related to rendering inside status causing corrupt output, avoiding exceptions on Rows with no children, as well as addressing rendering bugs in TextPath.
New features have been added, such as the ability to show separators between table rows. Other notable additions include progress bar header and footer support, customizable (and localizable) help providers, and the option to style text and confirmation prompts.
New Contributors
- @icalvo made their first contribution in #1215
- @fredrikbentzen made their first contribution in #1132
- @jeppevammenkristensen made their first contribution in #1241
- @tomaszprasolek made their first contribution in #1257
- @olabacker made their first contribution in #1302
- @AndrewRathbun made their first contribution in #1315
What's Changed
Rendering
- Add .NET 8 support by @patriksvensson in #1367
- Fixed render issue where writeline inside status caused corrupt output #415 #694 by @fredrikbentzen in #1132
- Relax the SDK requirements by rolling forward to the latest feature by @0xced in #1237
- Add fix to avoid exception on rows with no children by @jeppevammenkristensen in #1241
- Set
end_of_linetoLFinstead ofCRLFby @0xced in #1256 - Fix
Rulewidget docs by @tomaszprasolek in #1257 - Added the missing columns-cast by @nils-a in #1294
- Render tables with zero-width columns by @Frassle in #1197
- Fix figlet centering possibly throwing due to negative size by @olabacker in #1302
- Add option to show separator between table rows by @patriksvensson in #1304
- Enable setting the color of the values in a
BreakdownChartby @nils-a in #1303 - Progress bar header and footer by @phil-scott-78 in #1262
- Add an example showing the decorations off by @Frassle in #1191
- Fixes
TextPathrendering bugs by @patriksvensson in #1308 - Fix greedy row measure by @nils-a in #1338
- Fix
AnsiConsoleOutputsafe height by @0xced in #1358 - Allow passing a nullable style in
DefaultValueStyle()andChoicesStyle()by @0xced in #1359 - Allow
ConfirmationPromptStyling by @wbaldoumas in #1210
CLI
- Add async command unit tests by @FrankRay78 in #1228
- Add support for async delegate by @icalvo in #1215
- Remove unnecessary
[NotNull]attributes by @0xced in #1255 - Allow custom help providers by @FrankRay78 in #1259
- Specified details for settings for the argument vector by @nils-a in #1301
- Add support for localisation in help provider by @FrankRay78 in #1349
- Fix DefaultValue for
FileInfoandDirectoryInfoby @0xced in #1238
Documentation & Samples
- Added a minimal PR template by @nils-a in #1318
- Fix typo in
showcasesample by @AndrewRathbun in #1315 - Update
columnssample to showcase nicer data by @nils-a in #1295 - Change all
SetErrorHandlertoSetExceptionHandlerby @nils-a in #1298
Other stuff
- Ensure the
Generatorproject compiles by @patriksvensson in #1371
0.47.0
What's Changed
- Add Alacritty to the supported terminals in AnsiDetector by @MaxAtoms in #1211
- Add an implicit operator to convert from Color to Style by @0xced in #1160
- Allow case-insensitive confirmation prompt by @MartinZikmund in #1151
- Allow configuration of confirmation prompt comparison via
StringComparerby @MartinZikmund in #1161 - Do not register analyzer if SpectreConsole is not available in the current compilation by @meziantou in #1172
- Ensure correct comparer is used for
TextPromptby @MartinZikmund in #1152 - Forward CancellationToken to GetOperation by @meziantou in #1173
- Fix minor typo in Prompt example by @Frassle in #1183
- Fix coconut spelling by @phillip-haydon in #1218
- Improve conversion error messages by @0xced in #1141
- Make the code fix more robust and detect more symbols of type IAnsiConsole by @meziantou in #1169
- Minor Refactorings by @Elisha-Aguilera in #1081
- Simplify access to the SemanticModel in analyzers by @meziantou in #1167
- Use SymbolEqualityComparer.Default when possible by @meziantou in #1171
- Use StringComparison.Ordinal instead of culture-sensitive comparisons by @meziantou in #1174
Command line updates
- Add possibility to set description and/or data for the default command by @0xced in #1091
- Add support for converting command parameters into FileInfo and DirectoryInfo by @0xced in #1145
- Add support for arrays in [DefaultValue] attributes by @0xced in #1164
- Add ability to pass example args using
paramssyntax by @seclerp in #1166 - Alias for branches by @ilyahryapko in #1131
- Command line improvements by @FrankRay78 in #1103
Documentation updates
- Alignment => Justification Docs Fixes by @wbaldoumas in #1143
New Contributors
- @wbaldoumas made their first contribution in #1143
- @MartinZikmund made their first contribution in #1151
- @ilyahryapko made their first contribution in #1131
- @meziantou made their first contribution in #1174
- @MaxAtoms made their first contribution in #1211
- @phillip-haydon made their first contribution in #1218
Full Changelog: 0.46.0...0.47.0