From fc02a41aad30f3abaa0abda52313a1e844b022d9 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Mon, 14 Jul 2003 17:44:00 +0000 Subject: [PATCH] Added support for pressing esc in shell so it escapes the current line and allows you to type a new command Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1136 --- src/shell/shell_misc.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/shell/shell_misc.cpp b/src/shell/shell_misc.cpp index efb8c696..249ccde5 100644 --- a/src/shell/shell_misc.cpp +++ b/src/shell/shell_misc.cpp @@ -231,6 +231,16 @@ void DOS_Shell::InputCommand(char * line) { } } break; + case 0x1b: /* ESC */ + //write a backslash and return to the next line + outc('\\'); + outc('\n'); + *line = 0; // reset the line. + if (l_completion.size()) l_completion.clear(); //reset the completion list. + this->InputCommand(line); //Get the NEW line. + size = 0; // stop the next loop + str_len = 0; // prevent multiple adds of the same line + break; default: if (l_completion.size()) l_completion.clear(); line[str_index]=c;