Skip to content

Commit

Permalink
imp - Let Terminaux manage color ramp clearing
Browse files Browse the repository at this point in the history
---

Terminaux attempts to clear the screen on resize, so we need to use this feature instead of re-implementing it.

The next commit will spread this change all over the kernel and its extras.

---

Type: imp
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Feb 28, 2024
1 parent ab473ab commit c4595d6
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions public/Nitrocid/ConsoleBase/ConsoleTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,8 @@ internal static void ShowColorRampAndSet()
{
var screen = new Screen();
var rampPart = new ScreenPart();
bool clear = true;
ScreenTools.SetCurrent(screen);

// Clear screen if needed
rampPart.AddDynamicText(() =>
{
if (clear || Terminaux.Base.ConsoleResizeHandler.WasResized())
{
clear = false;
return
VtSequenceBuilderTools.BuildVtSequence(VtSequenceSpecificTypes.CsiCursorPosition, 1, 1) +
VtSequenceBuilderTools.BuildVtSequence(VtSequenceSpecificTypes.CsiEraseInDisplay, 0);
}
return "";
});

// Show a tip
rampPart.AddDynamicText(() =>
{
Expand Down

0 comments on commit c4595d6

Please sign in to comment.