Unable to detect when key is being held down in crossterm #19650

Closed
opened 2026-01-31 06:49:43 +00:00 by claunia · 3 comments
Owner

Originally created by @lesleyrs on GitHub (Apr 6, 2023).

Windows Terminal version

1.16.10261.0

Windows build number

10.0.19045.0

Other Software

Crossterm crate https://crates.io/crates/crossterm 0.26.1 latest

Steps to reproduce

Crossterm is a terminal library that recently added the ability to detect when a key is being held down and released.

On both conhost and wezterm this works as intended. In the crate if you run cargo run --example event-poll-read in both of these terminals it will correctly show input.

While on windows terminal for keys that produce letters it will just send "released" right after "pressed". Some other keys like arrow keys and tab do work correctly though.

This is not only a lack of functionality but can also create some weird side effects by keys being released unintentionally.

Expected Behavior

Example of conhost correctly registering key presses and only release when released:

image

Actual Behavior

In windows terminal it looks like:

image

Originally created by @lesleyrs on GitHub (Apr 6, 2023). ### Windows Terminal version 1.16.10261.0 ### Windows build number 10.0.19045.0 ### Other Software Crossterm crate https://crates.io/crates/crossterm 0.26.1 latest ### Steps to reproduce Crossterm is a terminal library that recently added the ability to detect when a key is being held down and released. On both conhost and wezterm this works as intended. In the crate if you run `cargo run --example event-poll-read` in both of these terminals it will correctly show input. While on windows terminal for keys that produce letters it will just send "released" right after "pressed". Some other keys like arrow keys and tab do work correctly though. This is not only a lack of functionality but can also create some weird side effects by keys being released unintentionally. ### Expected Behavior Example of conhost correctly registering key presses and only release when released: ![image](https://user-images.githubusercontent.com/19632758/230240057-b55f096a-09d0-443d-8303-f34f707c37cc.png) ### Actual Behavior In windows terminal it looks like: ![image](https://user-images.githubusercontent.com/19632758/230240221-882083ae-3cdd-495e-9390-ce7ad2e37eff.png)
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 06:49:43 +00:00
Author
Owner

@lesleyrs commented on GitHub (Apr 6, 2023):

Just to be clear it's not just me with this issue, most people using crossterm fixed it by only checking for key press OR release. But that doesn't fix the problem.

@lesleyrs commented on GitHub (Apr 6, 2023): Just to be clear it's not just me with this issue, most people using crossterm fixed it by only checking for key press OR release. But that doesn't fix the problem.
Author
Owner

@DHowett commented on GitHub (Apr 6, 2023):

Hey, thanks for the excellent repro! We're actually tracking this over in /dup #8440, and it's blocked on the Windows input subsystem Terminal is using (it doesn't give us as much fine-grained info as the old Windows Console one). Really sorry about that! Please subscribe over there for updates. 😄

@DHowett commented on GitHub (Apr 6, 2023): Hey, thanks for the excellent repro! We're actually tracking this over in /dup #8440, and it's blocked on the Windows input subsystem Terminal is using (it doesn't give us as much fine-grained info as the old Windows Console one). Really sorry about that! Please subscribe over there for updates. :smile:
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Apr 6, 2023):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (Apr 6, 2023): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19650