Skip to content

AnsiConsole.Write is overwriting output #673

Answered by patriksvensson
Mxater asked this question in Q&A
Discussion options

You must be logged in to vote

This is a known limitation when rendering within a Status or Progress context.

We calculate the updates based on the lines added to the buffer between every update, and if there is no newline at the time of the update, the content will be erased (since Spectre.Console doesn't know that any lines have been added).
This could probably be fixable but would require some work.

You can work around this by only rendering complete lines to the console.

using System.Text;
using Spectre.Console;

AnsiConsole.Status()
    .Spinner(Spinner.Known.Dots)
    .Start("Conectando...", ctx => 
    {
        // Build up the line in separate steps
        var builder = new StringBuilder();
        builder.Append

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Mxater
Comment options

Answer selected by patriksvensson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #672 on December 27, 2021 23:13.