less
less copied to clipboard
On Windows, ^X doesn't interrupt F mode if any other key is pressed first
Steps to reproduce:
- Build less with Microsoft Visual C on Windows.
- While viewing a file, press F.
- While "Waiting for data" message is displayed, press "k".
- Press ^X.
Expected behavior: should exit F mode. Actual behavior: remains in F mode. Works as expected if step 3 is omitted.
The problem is that iread() calls win32_kbhit() and WIN32getch() to read the "k", and then calls WIN32ungetch(). After that, all subsequent iterations of this code re-read the "k" even if ^X is pressed. The ^X should somehow bypass the queue? Or maybe we don't really need to unget chars input while reading?
Fixed in 04746adebaa882844a054b50be33fa44b8252664.
Fix in 04746adebaa882844a054b50be33fa44b8252664 was bad; reverted it so this is still open.