Skip to content

Commit 36a49bc

Browse files
committed
fix: Adjust footer line calculation to ensure proper rendering
1 parent 87c6859 commit 36a49bc

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/Layout/AppShell.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ public sealed class AppShell(
3535
public override void Render()
3636
{
3737
Console.Clear();
38+
3839
int width = Console.WindowWidth;
40+
int height = Console.WindowHeight;
3941
ColorScheme colors = ActiveTheme.Colors;
4042

4143
string headerText = ConsoleHelper.PadCenter($" {Title.ToUpperInvariant()} ", width - 2);
@@ -46,11 +48,9 @@ public override void Render()
4648

4749
int contentEndLine = Console.CursorTop;
4850

49-
int footerLine = Console.WindowHeight - 3;
50-
if (contentEndLine < footerLine)
51-
{
52-
ConsoleHelper.WriteEmptyLines(footerLine - contentEndLine);
53-
}
51+
int footerLine = Math.Max(contentEndLine + 1, height - 4);
52+
53+
Console.SetCursorPosition(0, footerLine);
5454

5555
string footerL = LeftFooter ?? string.Empty;
5656
string footerR = RightFooter ?? string.Empty;
@@ -60,5 +60,6 @@ public override void Render()
6060
new Panel(title: null, content: new ConsoleText(footerText, colors.Muted)).Render();
6161

6262
Console.SetCursorPosition(0, contentEndLine);
63+
Console.WriteLine();
6364
}
6465
}

0 commit comments

Comments
 (0)