Skip to content

Commit 427d15f

Browse files
committed
Clear termnal background when not active
1 parent e9ad54d commit 427d15f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Retroworks.RCBus/Controls/VirtualTerminalControl.axaml.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
using Avalonia.Interactivity;
88
using Avalonia.Media;
99
using Avalonia.ReactiveUI;
10+
using Avalonia.Styling;
1011
using Avalonia.Threading;
12+
using Retroworks.RCBus.Services;
1113
using System;
1214
using System.Collections.Generic;
1315
using System.Globalization;
@@ -16,9 +18,9 @@
1618
using System.Text;
1719
using System.Threading.Tasks;
1820
using VtNetCore.VirtualTerminal;
21+
using VtNetCore.VirtualTerminal.Enums;
1922
using VtNetCore.VirtualTerminal.Model;
2023
using VtNetCore.XTermParser;
21-
using Retroworks.RCBus.Services;
2224

2325
namespace Retroworks.RCBus.Controls
2426
{
@@ -611,6 +613,11 @@ private void PaintBackgroundLayer(DrawingContext context, List<VtNetCore.Virtual
611613
{
612614
if (spans == null)
613615
{
616+
// Clear the background if there are no spans
617+
var terminalBackground = Application.Current?.ActualThemeVariant == ThemeVariant.Light ? ETerminalColor.White : ETerminalColor.Black;
618+
var background = new TerminalColor(terminalBackground, false).WebColor;
619+
var backgroundColor = GetSolidColorBrush(background);
620+
context.FillRectangle(backgroundColor, new Rect(0, 0, _panel.Bounds.Width, _panel.Bounds.Height));
614621
return;
615622
}
616623

0 commit comments

Comments
 (0)