Lock input line to bottom of terminal
This commit is contained in:
parent
f3372f39e4
commit
60ad19e914
|
@ -482,6 +482,8 @@ public class ClearCommand : Command {
|
||||||
public override void Handler(List<string> inputParams) {
|
public override void Handler(List<string> inputParams) {
|
||||||
lock (@lock) {
|
lock (@lock) {
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
|
if (lockInputToBottom)
|
||||||
|
Console.SetCursorPosition(0, Console.LargestWindowHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,9 @@ namespace tgcli;
|
||||||
|
|
||||||
// ReSharper disable once InconsistentNaming
|
// ReSharper disable once InconsistentNaming
|
||||||
public static class tgcli {
|
public static class tgcli {
|
||||||
public static volatile Td.TdClient client = new();
|
public const bool lockInputToBottom = true;
|
||||||
public static string dbdir = "";
|
public static volatile Td.TdClient client = new();
|
||||||
|
public static string dbdir = "";
|
||||||
public static volatile bool authorized;
|
public static volatile bool authorized;
|
||||||
public static volatile string connectionState = "Connecting";
|
public static volatile string connectionState = "Connecting";
|
||||||
public static long currentChatId = 0;
|
public static long currentChatId = 0;
|
||||||
|
@ -67,6 +68,8 @@ public static class tgcli {
|
||||||
Thread.Sleep(1);
|
Thread.Sleep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lockInputToBottom)
|
||||||
|
Console.SetCursorPosition(0, Console.LargestWindowHeight);
|
||||||
ScreenUpdate();
|
ScreenUpdate();
|
||||||
while (!quitting)
|
while (!quitting)
|
||||||
MainLoop();
|
MainLoop();
|
||||||
|
|
Loading…
Reference in a new issue