diff --git a/platforms/posix/src/main.cpp b/platforms/posix/src/main.cpp index 790d8f4947..35f563d1b5 100644 --- a/platforms/posix/src/main.cpp +++ b/platforms/posix/src/main.cpp @@ -533,11 +533,15 @@ int main(int argc, char **argv) while (!_ExitFlag) { - char c = getchar(); + int c = getchar(); string add_string; // string to add at current cursor position bool update_prompt = true; switch (c) { + case EOF: + _ExitFlag = true; + break; + case 127: // backslash if (mystr.length() - cursor_position > 0) { mystr.erase(mystr.length() - cursor_position - 1, 1);