diff --git a/sys/shell/shell.c b/sys/shell/shell.c index 95ea0b846bc9..c09856373697 100644 --- a/sys/shell/shell.c +++ b/sys/shell/shell.c @@ -33,6 +33,8 @@ #include "shell_commands.h" #define ETX '\x03' /** ASCII "End-of-Text", or ctrl-C */ +#define EOT '\x04' /** ASCII "End-of-Transmission", or ctrl-D */ + #if !defined(SHELL_NO_ECHO) || !defined(SHELL_NO_PROMPT) #ifdef MODULE_NEWLIB /* use local copy of putchar, as it seems to be inlined, @@ -235,7 +237,7 @@ static int readline(char *buf, size_t size) } int c = getchar(); - if (c < 0) { + if (c < 0 || c == EOT) { return EOF; }