diff --git a/userspace/Shell/main.cpp b/userspace/Shell/main.cpp index 78b4b3cb04..941db2edb7 100644 --- a/userspace/Shell/main.cpp +++ b/userspace/Shell/main.cpp @@ -908,7 +908,19 @@ int main(int argc, char** argv) while (true) { - uint8_t ch = getchar(); + int chi = getchar(); + if (chi == EOF) + { + if (errno == EINTR) + { + clearerr(stdin); + continue; + } + perror("getchar"); + return 1; + } + + uint8_t ch = chi; if (waiting_utf8 > 0) {