From c20579a835772f7fb024f8bfd26b815598992232 Mon Sep 17 00:00:00 2001 From: Patryk Obara Date: Wed, 11 Dec 2019 22:22:13 +0100 Subject: [PATCH] Display newline after key was pressed in 'pause' cmd Move newline from the string message to the WriteOut in command itself. This makes the PAUSE command behave like the original, which is important for commands like DIR /P. --- src/shell/shell.cpp | 2 +- src/shell/shell_cmds.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/shell/shell.cpp b/src/shell/shell.cpp index 39264221..8783f8f2 100644 --- a/src/shell/shell.cpp +++ b/src/shell/shell.cpp @@ -587,7 +587,7 @@ void SHELL_Init() { MSG_Add("SHELL_CMD_DIR_BYTES_FREE","%5d Dir(s) %17s Bytes free.\n"); MSG_Add("SHELL_EXECUTE_DRIVE_NOT_FOUND","Drive %c does not exist!\nYou must \033[31mmount\033[0m it first. Type \033[1;33mintro\033[0m or \033[1;33mintro mount\033[0m for more information.\n"); MSG_Add("SHELL_EXECUTE_ILLEGAL_COMMAND","Illegal command: %s.\n"); - MSG_Add("SHELL_CMD_PAUSE","Press any key to continue.\n"); + MSG_Add("SHELL_CMD_PAUSE","Press any key to continue..."); MSG_Add("SHELL_CMD_PAUSE_HELP","Waits for 1 keystroke to continue.\n"); MSG_Add("SHELL_CMD_COPY_FAILURE","Copy failure : %s.\n"); MSG_Add("SHELL_CMD_COPY_SUCCESS"," %d File(s) copied.\n"); diff --git a/src/shell/shell_cmds.cpp b/src/shell/shell_cmds.cpp index 24273a96..b43b45af 100644 --- a/src/shell/shell_cmds.cpp +++ b/src/shell/shell_cmds.cpp @@ -1047,12 +1047,15 @@ void DOS_Shell::CMD_REM(char * args) { HELP("REM"); } -void DOS_Shell::CMD_PAUSE(char * args){ +void DOS_Shell::CMD_PAUSE(char *args) { HELP("PAUSE"); WriteOut(MSG_Get("SHELL_CMD_PAUSE")); - Bit8u c;Bit16u n=1; - DOS_ReadFile(STDIN,&c,&n); - if (c==0) DOS_ReadFile(STDIN,&c,&n); // read extended key + uint8_t c; + uint16_t n = 1; + DOS_ReadFile(STDIN, &c, &n); + if (c == 0) + DOS_ReadFile(STDIN, &c, &n); // read extended key + WriteOut_NoParsing("\n"); } void DOS_Shell::CMD_CALL(char * args){