Skip to content

Multiline WriteLine causes artifacts with Progress, Status #415

@AHelper

Description

@AHelper

Information

  • OS: Windows 10
  • Version: 0.39.0
  • Terminal: Powershell, Windows Terminal

Describe the bug
It appears that AnsiConsole.WriteLine (and MarkdownLine, etc.) doesn't handle lines that are longer than the console width when a status or progress is also rendered.

To Reproduce
Here's an example the demonstrates the problem:

using System.Linq;
using Spectre.Console;

AnsiConsole.Status()
           .Start("This is a really long status message that will get written over", ctx =>
           {
               foreach (var width in Enumerable.Range(1, 200))
               {
                   AnsiConsole.WriteLine(string.Join("", Enumerable.Repeat('x', width)));
               }
           });

Expected behavior
WriteLine should prevent rendered status/progress bar from getting overwritten and mixed into the output.

Screenshots
spectre-line-wrap-bug
A Thread.Sleep was added in the foreach for the screenshot above, otherwise the same code

Additional context

  • A workaround is to chunk output text by console width and print each.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions