Skip to content

Commit

Permalink
Revert "Fixed render issue where writeline inside status caused corru…
Browse files Browse the repository at this point in the history
…pt output #415 #694"

This reverts commit 71a5d83.

The commit introduced major flickering when working with LiveRenderables

Fixes #1466
  • Loading branch information
phil-scott-78 authored and patriksvensson committed Apr 1, 2024
1 parent 1a3249c commit fc0b553
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/Spectre.Console/Live/LiveRenderable.cs
Expand Up @@ -49,7 +49,7 @@ public IRenderable PositionCursor()
}

var linesToMoveUp = _shape.Value.Height - 1;
return new ControlCode("\r" + (EL(2) + CUU(1)).Repeat(linesToMoveUp));
return new ControlCode("\r" + CUU(linesToMoveUp));
}
}

Expand Down
@@ -1,10 +1,10 @@
[?25l
* foo



- bar



* baz

[?25h

This file was deleted.

26 changes: 0 additions & 26 deletions test/Spectre.Console.Tests/Unit/Live/StatusTests.cs
Expand Up @@ -48,30 +48,4 @@ public Task Should_Render_Status_Correctly()
// Then
return Verifier.Verify(console.Output);
}

[Fact]
[Expectation("WriteLineOverflow")]
public Task Should_Render_Correctly_When_WriteLine_Exceeds_Console_Width()
{
// Given
var console = new TestConsole()
.Colors(ColorSystem.TrueColor)
.Width(100)
.Interactive()
.EmitAnsiSequences();
var status = new Status(console)
{
AutoRefresh = false,
};

// When
status.Start("long text that should not interfere writeline text", ctx =>
{
ctx.Refresh();
console.WriteLine("x".Repeat(console.Profile.Width + 10), new Style(foreground: Color.White));
});

// Then
return Verifier.Verify(console.Output);
}
}

0 comments on commit fc0b553

Please sign in to comment.