Skip to content

Fixes 4191 - Rewrite WindowsOutput #4193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 19 commits into
base: v2_develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Terminal.Gui/Drivers/V2/IOutputBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ namespace Terminal.Gui.Drivers;
/// </summary>
public interface IOutputBuffer
{
/// <summary>
/// As performance is a concern, we keep track of the dirty lines and only refresh those.
/// This is in addition to the dirty flag on each cell.
/// </summary>
public bool [] DirtyLines { get; }

/// <summary>
/// The contents of the application output. The driver outputs this buffer to the terminal when UpdateScreen is called.
Expand Down
7 changes: 0 additions & 7 deletions Terminal.Gui/Drivers/V2/MainLoopCoordinator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ internal class MainLoopCoordinator<T> : IMainLoopCoordinator
private ConsoleDriverFacade<T> _facade;
private Task _inputTask;
private readonly ITimedEvents _timedEvents;
private readonly bool _isWindowsTerminal;

private readonly SemaphoreSlim _startupSemaphore = new (0, 1);

Expand Down Expand Up @@ -61,7 +60,6 @@ IMainLoop<T> loop
_inputProcessor = inputProcessor;
_outputFactory = outputFactory;
_loop = loop;
_isWindowsTerminal = Environment.GetEnvironmentVariable ("WT_SESSION") is { } || Environment.GetEnvironmentVariable ("VSAPPIDNAME") != null;
}

/// <summary>
Expand Down Expand Up @@ -162,11 +160,6 @@ private void BuildFacadeIfPossible ()
_loop.AnsiRequestScheduler,
_loop.WindowSizeMonitor);

if (!_isWindowsTerminal)
{
Application.Force16Colors = _facade.Force16Colors = true;
}

Application.Driver = _facade;

_startupSemaphore.Release ();
Expand Down
6 changes: 0 additions & 6 deletions Terminal.Gui/Drivers/V2/NetOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,11 @@ public void Write (IOutputBuffer buffer)
return;
}

if (!buffer.DirtyLines [row])
{
continue;
}

if (!SetCursorPositionImpl (0, row))
{
return;
}

buffer.DirtyLines [row] = false;
output.Clear ();

for (int col = left; col < cols; col++)
Expand Down
Loading
Loading