diff --git a/tgcli/Command.cs b/tgcli/Command.cs index 37584ec..79d2b50 100644 --- a/tgcli/Command.cs +++ b/tgcli/Command.cs @@ -482,6 +482,8 @@ public class ClearCommand : Command { public override void Handler(List inputParams) { lock (@lock) { Console.Clear(); + if (lockInputToBottom) + Console.SetCursorPosition(0, Console.LargestWindowHeight); } } } diff --git a/tgcli/tgcli.cs b/tgcli/tgcli.cs index 619b588..219b2e7 100644 --- a/tgcli/tgcli.cs +++ b/tgcli/tgcli.cs @@ -26,8 +26,9 @@ namespace tgcli; // ReSharper disable once InconsistentNaming public static class tgcli { - public static volatile Td.TdClient client = new(); - public static string dbdir = ""; + public const bool lockInputToBottom = true; + public static volatile Td.TdClient client = new(); + public static string dbdir = ""; public static volatile bool authorized; public static volatile string connectionState = "Connecting"; public static long currentChatId = 0; @@ -67,6 +68,8 @@ public static class tgcli { Thread.Sleep(1); } + if (lockInputToBottom) + Console.SetCursorPosition(0, Console.LargestWindowHeight); ScreenUpdate(); while (!quitting) MainLoop();