WaitForSingleObject seems to receive a key release event without releasing the key #18170

Open
opened 2026-01-31 06:05:44 +00:00 by claunia · 0 comments
Owner

Originally created by @iFuSiiOnzZ on GitHub (Aug 12, 2022).

Windows Terminal version

1.14.1962.0

Windows build number

10.0.19043.1889

Other Software

C source to reproduce the bug.

Steps to reproduce

Use a C compiler as Visual CL. Build the source code posted "Other Software" section. Run the application build on Windows Terminal and press a key without releasing it, a key press and key release event is generated continuously.

Expected Behavior

Key press generates an event where "KeyEvent.bKeyDown" is true.
Key release generates an event where "KeyEvent.bKeyDown" is false.

Actual Behavior

When key is press an event is sent having the "KeyEvent.bKeyDown" to true, afterwards it generates a key release event, "KeyEvent.bKeyDown" to false, and it continuously generating key press and key release events without releasing the key.

In Command prompt and Powershell it works as expected.
key_events

Originally created by @iFuSiiOnzZ on GitHub (Aug 12, 2022). ### Windows Terminal version 1.14.1962.0 ### Windows build number 10.0.19043.1889 ### Other Software [C source to reproduce the bug](https://pastebin.com/aHanPw4q). ### Steps to reproduce Use a C compiler as Visual CL. Build the source code posted "Other Software" section. Run the application build on Windows Terminal and press a key without releasing it, a key press and key release event is generated continuously. ### Expected Behavior Key press generates an event where "KeyEvent.bKeyDown" is true. Key release generates an event where "KeyEvent.bKeyDown" is false. ### Actual Behavior When key is press an event is sent having the "KeyEvent.bKeyDown" to true, afterwards it generates a key release event, "KeyEvent.bKeyDown" to false, and it continuously generating key press and key release events without releasing the key. In Command prompt and Powershell it works as expected. ![key_events](https://user-images.githubusercontent.com/1687423/184444919-d45b9e11-4536-4f5d-affc-ed77b2bc2466.jpg)
claunia added the Needs-TriageIssue-BugNeeds-Tag-Fix labels 2026-01-31 06:05:44 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18170