Unless some WriteConsoleW()
call happens between two ReadConsoleInputW()
calls, using
SetConsoleMode()
to set/clear the ENABLE_MOUSE_INPUT
mode flag doesn't take effect.
- This is a regression in Terminal 1.18.1462.0.
- The problem does not exist in Terminal 1.17.11461.0.
The repo includes a pre-built code-signed copy of the Repro.exe executable.
- Start Windows Terminal 1.18
- Run the
Repro.exe
program from this repo - Move the mouse over the terminal window; you should see no output
- Click the primary mouse button on the terminal window; you should see no output
- Hold Ctrl+Alt and move the mouse or click the mouse button
EXPECTED:
- You should see output acknowledging that ReadConsoleInputW received mouse input records.
ACTUAL:
- Terminal 1.18 -- there is not output (incorrect behavior).
- Terminal 1.17 -- the output reports received mouse input records (correct behavior).
If in step 2 you instead run Repro.exe --verbose
then the program prints verbose output
acknowleding when Ctrl+Alt are pressed or released and indicating the new
console mode being used.
The additional verbose output line eliminates the repro, and makes the ENABLE_MOUSE_INPUT
change
properly affect the WaitForSingleObject(in, INFINITE)
call.
So, in Terminal 1.18, unless some WriteConsoleW()
call happens between two ReadConsoleInputW()
calls, using SetConsoleMode()
to set/clear ENABLE_MOUSE_INPUT
doesn't take effect.