mirror of
https://github.com/reactos/reactos.git
synced 2025-06-13 16:48:32 +00:00
[CMD] Improve how the command prompt displays when one presses Ctrl-C/break after having pressed ENTER, or after a command has been run.
This commit is contained in:
parent
a3b36f8d3e
commit
03c233bcd0
2 changed files with 11 additions and 7 deletions
|
@ -1418,16 +1418,14 @@ ReadLine(TCHAR *commandline, BOOL bMore)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CheckCtrlBreak(BREAK_INPUT))
|
if (readline[0] == _T('\0'))
|
||||||
{
|
|
||||||
ConOutChar(_T('\n'));
|
ConOutChar(_T('\n'));
|
||||||
|
|
||||||
|
if (CheckCtrlBreak(BREAK_INPUT))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
|
||||||
|
|
||||||
if (readline[0] == _T('\0'))
|
if (readline[0] == _T('\0'))
|
||||||
{
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
|
||||||
|
|
||||||
ip = readline;
|
ip = readline;
|
||||||
}
|
}
|
||||||
|
|
|
@ -453,8 +453,14 @@ BOOL ReadCommand(LPTSTR str, INT maxlen)
|
||||||
if ((ir.Event.KeyEvent.dwControlKeyState &
|
if ((ir.Event.KeyEvent.dwControlKeyState &
|
||||||
(RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED)))
|
(RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED)))
|
||||||
{
|
{
|
||||||
/* A CTRL-C. Don't clear the the command line,
|
/* Ignore the Ctrl-C key event if it has already been handled */
|
||||||
* but return an empty string in str. */
|
if (!bCtrlBreak)
|
||||||
|
break;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A Ctrl-C. Do not clear the command line,
|
||||||
|
* but return an empty string in str.
|
||||||
|
*/
|
||||||
str[0] = _T('\0');
|
str[0] = _T('\0');
|
||||||
curx = orgx;
|
curx = orgx;
|
||||||
cury = orgy;
|
cury = orgy;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue