Skip to content
Merged
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
6 changes: 4 additions & 2 deletions Terminal.Gui/Drivers/AnsiDriver/AnsiOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class AnsiOutput : OutputBase, IOutput
// Tracks which underlying platform APIs are in use
private readonly AnsiPlatform _platform;

private Size _consoleSize = new (80, 25);
private Size _consoleSize;
private IOutputBuffer? _lastBuffer;

private readonly WindowsVTOutputHelper? _windowsVTOutput;
Expand Down Expand Up @@ -71,7 +71,6 @@ public AnsiOutput (AppModel appModel = AppModel.FullScreen)
_platform = AnsiPlatform.Degraded;

_lastBuffer = new OutputBufferImpl ();
_lastBuffer.SetSize (80, 25);
_currentCursor = new Cursor ();

try
Expand All @@ -86,6 +85,9 @@ public AnsiOutput (AppModel appModel = AppModel.FullScreen)
// Check if we have a real console first
if (!IsAttachedToTerminal)
{
_consoleSize = new Size (80, 25);
_lastBuffer.SetSize (_consoleSize.Width, _consoleSize.Height);

Trace.Lifecycle (nameof (AnsiOutput), "Init", "No real terminal attached. Running in degraded mode.");

return;
Expand Down
Loading