mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2025-08-18 12:45:36 +00:00
Add clear with "clear", "cls" and Ctrl+L
This commit is contained in:
parent
52bf3cdd21
commit
01e02edf8c
@ -27,6 +27,9 @@ void HandleInput(const std::string& cmd) {
|
||||
std::cout << std::endl;
|
||||
if (cmd == "exit") {
|
||||
_Exit(0);
|
||||
} else if (cmd == "clear" || cmd == "cls") {
|
||||
// 2J is clearscreen, H is reset position to top-left
|
||||
ConsoleOut("\x1b[2J\x1b[H");
|
||||
} else {
|
||||
LuaConsole->Execute(cmd);
|
||||
}
|
||||
@ -175,7 +178,7 @@ static void ProcessCompositeInput() {
|
||||
DebugPrintTID();
|
||||
while (true) {
|
||||
int In = _getch();
|
||||
//info(std::to_string(In));
|
||||
// info(std::to_string(In));
|
||||
if (CompositeInputExpected) {
|
||||
CompositeInput += char(In);
|
||||
#ifdef WIN32
|
||||
@ -201,6 +204,10 @@ static void ProcessCompositeInput() {
|
||||
CInputBuff = "exit";
|
||||
HandleInput(CInputBuff);
|
||||
CInputBuff.clear();
|
||||
} else if (In == 12) {
|
||||
CInputBuff = "clear";
|
||||
HandleInput(CInputBuff);
|
||||
CInputBuff.clear();
|
||||
#ifdef WIN32
|
||||
} else if (In == 224) {
|
||||
#else // unix
|
||||
|
Loading…
x
Reference in New Issue
Block a user