Skip to content

Overwrite colorized lines instead of incremental updates#8907

Merged
rainersigwald merged 3 commits intodotnet:mainfrom
rainersigwald:minimal-truncation-fix
Jun 20, 2023
Merged

Overwrite colorized lines instead of incremental updates#8907
rainersigwald merged 3 commits intodotnet:mainfrom
rainersigwald:minimal-truncation-fix

Conversation

@rainersigwald
Copy link
Copy Markdown
Member

The root cause of #8781 is that the optimize-output-by-skipping-identical-characters logic is not aware of escape sequences, so it goes horribly awry when the replacing line differs after the first escape sequence.

Instead, apply the previous logic only if there are no escape sequences; if there are, replace the entire line.

If this proves to cause too much flicker or perform slowly, we could implement escape-sequence-aware truncation, length, and comparison, but we can wait for feedback to that effect.

Make `DisplayNodes()` internal so that we can call it from tests in
order to verify the "live" logger output at known checkpoints.
The root cause of dotnet#8781 is that the optimize-output-by-skipping-
identical-characters logic is not aware of escape sequences, so it goes
horribly awry when the replacing line differs after the first escape
sequence.

Instead, apply the previous logic only if there are no escape sequences;
if there are, replace the entire line.

If this proves to cause too much flicker or perform slowly, we could
implement escape-sequence-aware truncation, length, and comparison, but
we can wait for feedback to that effect.
Copy link
Copy Markdown
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks easy and effective (if UX speed will suffice)

Copy link
Copy Markdown
Member

@ladipro ladipro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good and performs well on my slow machine.

@rainersigwald rainersigwald merged commit 363f522 into dotnet:main Jun 20, 2023
@rainersigwald rainersigwald deleted the minimal-truncation-fix branch June 20, 2023 16:46
rainersigwald added a commit to rainersigwald/msbuild that referenced this pull request Jun 20, 2023
These ESC]9;4;3; (start indefinite-progress spin) sequences
were added in dotnet#8883, but collided with dotnet#8907.
rainersigwald added a commit that referenced this pull request Jun 21, 2023
These ESC]9;4;3; (start indefinite-progress spin) sequences
were added in #8883, but collided with #8907.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants