Cygwin: console: Fix a bug on input when signalled.
- This patch fixes the bug that Ctrl-C sometimes does not work as expected in Windows Terminal. Addresses: https://cygwin.com/pipermail/cygwin/2021-November/249749.html
This commit is contained in:
parent
045ce20177
commit
561767fc59
|
@ -1178,6 +1178,10 @@ out:
|
||||||
/* Discard processed recored. */
|
/* Discard processed recored. */
|
||||||
DWORD dummy;
|
DWORD dummy;
|
||||||
DWORD discard_len = min (total_read, i + 1);
|
DWORD discard_len = min (total_read, i + 1);
|
||||||
|
/* If input is signalled, do not discard input here because
|
||||||
|
tcflush() is already called from line_edit(). */
|
||||||
|
if (stat == input_signalled && !(ti->c_lflag & NOFLSH))
|
||||||
|
discard_len = 0;
|
||||||
if (discard_len)
|
if (discard_len)
|
||||||
ReadConsoleInputW (get_handle (), input_rec, discard_len, &dummy);
|
ReadConsoleInputW (get_handle (), input_rec, discard_len, &dummy);
|
||||||
return stat;
|
return stat;
|
||||||
|
|
Loading…
Reference in New Issue