Using SetConsoleMode to set/clear ENABLE_MOUSE_INPUT does not take effect (unless a WriteConsoleW call occurs as well) #20235

Open
opened 2026-01-31 07:07:40 +00:00 by claunia · 0 comments
Owner

Originally created by @chrisant996 on GitHub (Jul 14, 2023).

Originally assigned to: @lhecker on GitHub.

Windows Terminal version

1.18.1462.0

Windows build number

10.0.19045.3208

Other Software

I've provided a minimal standalone repro here to eliminate dependencies on anything other than Terminal.
But for completeness: this was discovered in the context of Clink.

Steps to reproduce

This is a regression in 1.18; the problem does not exist in 1.17 and earlier.

Minimal repro program is available at https://github.com/chrisant996/repro_enable_mouse_input.
The repo also includes a pre-built code-signed Repro.exe executable.

See the Readme.md file in that repo for full details and repro instructions.

  1. Start Windows Terminal 1.18
  2. Run the Repro.exe program from the repro_enable_mouse_input repo (you can build it yourself from the sources, or you can run the pre-built code-signed copy)
  3. Move the mouse over the terminal window; you should see no output
  4. Click the primary mouse button on the terminal window; you should see no output
  5. Hold Ctrl+Alt and move the mouse or click the mouse button

Expected Behavior

  • You should see output acknowledging that ReadConsoleInputW received mouse input records.

Actual Behavior

  • Terminal 1.18 -- there is no output (incorrect behavior).
  • Terminal 1.17 -- the output reports received mouse input records (correct behavior).
Originally created by @chrisant996 on GitHub (Jul 14, 2023). Originally assigned to: @lhecker on GitHub. ### Windows Terminal version 1.18.1462.0 ### Windows build number 10.0.19045.3208 ### Other Software I've provided a minimal standalone repro here to eliminate dependencies on anything other than Terminal. But for completeness: this was discovered in the context of [Clink](https://github.com/chrisant996/clink). ### Steps to reproduce This is a regression in 1.18; the problem does not exist in 1.17 and earlier. Minimal repro program is available at https://github.com/chrisant996/repro_enable_mouse_input. The repo also includes a pre-built code-signed `Repro.exe` executable. **See the Readme.md file in that repo for full details and repro instructions.** 1. Start Windows Terminal 1.18 2. Run the `Repro.exe` program from the [repro_enable_mouse_input](https://github.com/chrisant996/repro_enable_mouse_input) repo (you can build it yourself from the sources, or you can run the pre-built code-signed copy) 3. Move the mouse over the terminal window; you should see no output 4. Click the primary mouse button on the terminal window; you should see no output 5. Hold <kbd>Ctrl</kbd>+<kbd>Alt</kbd> and move the mouse or click the mouse button ### Expected Behavior - You should see output acknowledging that ReadConsoleInputW received mouse input records. ### Actual Behavior - Terminal 1.18 -- there is no output (incorrect behavior). - Terminal 1.17 -- the output reports received mouse input records (correct behavior).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20235