Dock an input on the bottom
using System;
using System.Text;
class Program
{
static void Main()
{
Console.OutputEncoding = System.Text.Encoding.Unicode;
RenderConsole.SetConsoleFont("MesloLGL Nerd Font", 18);
RenderConsole.WindowsConsoleMode.TryEnableVirtualTerminalProcessing();
RenderConsole.SetConsoleSizeAndLock(120, 40);
ConsoleConfiguration.ConfigureConsole();
Console.Title = "";
Console.Clear();
int lastRow = Console.WindowHeight - 1;
if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)) {
Console.SetBufferSize(Console.WindowWidth, Console.WindowHeight);
}
while (true)
{
if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)) {
Console.MoveBufferArea(0, 1, Console.WindowWidth, 0, 0, 0);
}
Console.SetCursorPosition(0, lastRow);
Console.Write($"{Fore.RGB(40, 54, 24)}\uE0BE{Fore.RESET()}{Background.RGB(40, 54, 24)} user@machine {Background.RESET()}{Fore.RGB(40, 54, 24)}{Background.RGB(96, 108, 56)}\uE0B0 {Fore.RGB(254, 250, 224)}\uF121{Fore.RESET()} {Background.RESET()}{Fore.RGB(96, 108, 56)}\uE0B0 {Style.RESET()}");
string? input = Console.ReadLine();
if (string.IsNullOrEmpty(input))
break;
Console.SetCursorPosition(0, lastRow - 1);
Console.Write(new string(' ', Console.WindowWidth));
Console.SetCursorPosition(0, lastRow - 1);
Console.Write(input);
}
}
}
using System;
using System.Text;
class Program
{
static void Main()
{
Console.OutputEncoding = System.Text.Encoding.Unicode;
RenderConsole.SetConsoleFont("MesloLGL Nerd Font", 18);
RenderConsole.WindowsConsoleMode.TryEnableVirtualTerminalProcessing();
RenderConsole.SetConsoleSizeAndLock(120, 40);
ConsoleConfiguration.ConfigureConsole();
Console.Title = "";
Console.Clear();
int lastRow = Console.WindowHeight - 1;
if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)) {
Console.SetBufferSize(Console.WindowWidth, Console.WindowHeight);
}
while (true)
{
if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)) {
Console.MoveBufferArea(0, 1, Console.WindowWidth, 0, 0, 0);
}
Console.SetCursorPosition(0, lastRow);
Console.Write($"{Fore.RGB(40, 54, 24)}\uE0BE{Fore.RESET()}{Background.RGB(40, 54, 24)} user@machine {Background.RESET()}{Fore.RGB(40, 54, 24)}{Background.RGB(96, 108, 56)}\uE0B0 {Fore.RGB(254, 250, 224)}\uF121{Fore.RESET()} {Background.RESET()}{Fore.RGB(96, 108, 56)}\uE0B0 {Style.RESET()}");
string? input = Console.ReadLine();
if (string.IsNullOrEmpty(input))
break;
Console.SetCursorPosition(0, lastRow - 1);
Console.Write(new string(' ', Console.WindowWidth));
Console.SetCursorPosition(0, lastRow - 1);
Console.Write(input);
}
}
}
1 Reply