diff --git a/src/Console.cpp b/src/Console.cpp index c623b9f..2cddb8e 100644 --- a/src/Console.cpp +++ b/src/Console.cpp @@ -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