diff --git a/src/main.c b/src/main.c index 62c7bb7..9e3351f 100644 --- a/src/main.c +++ b/src/main.c @@ -18,6 +18,13 @@ MSH_ENTRY_POINT { msh_print_strings(msh_working_directory(), " %> ", 0); while ((out = msh_read_input(buf, &sz, 2048)), out > 0) { + switch (out) { + /* Ctrl-C */ + case 0x3: + msh_print_string("^C\n\r"); + goto end_loop; + break; + } } if (*buf != '\0') { @@ -27,6 +34,7 @@ MSH_ENTRY_POINT { // msh_execute(buf, args); + end_loop: msh_deallocate(buf); }