diff --git a/src/Console.cpp b/src/Console.cpp index 385e30b..75c5cfe 100644 --- a/src/Console.cpp +++ b/src/Console.cpp @@ -119,6 +119,7 @@ void SetupConsole() { #endif // WIN32 } +#ifndef WIN32 static std::vector ConsoleHistory {}; static size_t ConsoleHistoryReadIndex { 0 }; @@ -162,12 +163,14 @@ static void ProcessCompositeInput() { ConsoleHistoryReadIndex = ConsoleHistory.size(); } } +#endif // WIN32 [[noreturn]] void ReadCin() { DebugPrintTID(); while (true) { int In = _getch(); //info(std::to_string(In)); +#ifndef WIN32 if (CompositeInputExpected) { CompositeInput += In; if (CompositeInput.size() == 2) { @@ -176,10 +179,13 @@ static void ProcessCompositeInput() { } continue; } +#endif // WIN32 if (In == 13 || In == '\n') { if (!CInputBuff.empty()) { HandleInput(CInputBuff); +#ifndef WIN32 ConsoleHistoryAdd(CInputBuff); +#endif // WIN32 CInputBuff.clear(); } } else if (In == 8 || In == 127) { @@ -189,10 +195,12 @@ static void ProcessCompositeInput() { CInputBuff = "exit"; HandleInput(CInputBuff); CInputBuff.clear(); +#ifndef WIN32 } else if (In == 27) { // escape char, assume stuff follows CompositeInputExpected = true; CompositeInput.clear(); +#endif // WIN32 } else if (!isprint(In)) { // ignore } else {