mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 23:03:00 +00:00
[CMD] Fix CTRL-C handling.
Using CTRL-C to cancel command line input would leave the prompt in a state where the next command would be ignored. For example: dir<CTRL-C> dir would cause cmd.exe to ignore the second dir command.
This commit is contained in:
parent
23de2099e0
commit
d7e71357dc
3 changed files with 24 additions and 6 deletions
|
@ -450,12 +450,23 @@ BOOL ReadCommand(LPTSTR str, INT maxlen)
|
|||
break;
|
||||
|
||||
case _T('C'):
|
||||
bCharInput = TRUE;
|
||||
if (!(ir.Event.KeyEvent.dwControlKeyState &
|
||||
if ((ir.Event.KeyEvent.dwControlKeyState &
|
||||
(RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED)))
|
||||
{
|
||||
break;
|
||||
/* A CTRL-C. Don't clear the the command line,
|
||||
* but return an empty string in str. */
|
||||
str[0] = L'\0';
|
||||
curx = orgx;
|
||||
cury = orgy;
|
||||
current = charcount = 0;
|
||||
bReturn = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Just a normal 'C' character */
|
||||
bCharInput = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case VK_RETURN:
|
||||
/* end input, return to main */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue