[PR #13981] Add support for DECARM (Auto Repeat Mode) #29872

Open
opened 2026-01-31 09:37:21 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/13981

State: closed
Merged: Yes


This PR adds support for the DECARM (Auto Repeat Mode) sequence, which
controls whether a keypress automatically repeats if you keep it held
down for long enough.

Note that this won't fully work in Windows Terminal until issue #8440 is
resolved.

Every time we receive a KeyDown event, we record the virtual key code
to track that as the last key pressed. If we receive a KeyUp event the
matches that last key code, we reset that field. Then if the Auto Repeat
Mode is reset, and we receive a KeyDown event that matches the last
key code, we simply ignore it.

Validation Steps Performed

I've manually tested the DECARM functionality in Vttest and confirmed
that it's working as expected. Although note that in Windows Terminal
this only applies to non-alphanumeric keys for now (e.g. Tab, BackSpace,
arrow keys, etc.)

I've also added a basic unit test that verifies that repeated key
presses are suppressed when the DECARM mode is disabled.

Closes #13919

**Original Pull Request:** https://github.com/microsoft/terminal/pull/13981 **State:** closed **Merged:** Yes --- This PR adds support for the `DECARM` (Auto Repeat Mode) sequence, which controls whether a keypress automatically repeats if you keep it held down for long enough. Note that this won't fully work in Windows Terminal until issue #8440 is resolved. Every time we receive a `KeyDown` event, we record the virtual key code to track that as the last key pressed. If we receive a `KeyUp` event the matches that last key code, we reset that field. Then if the Auto Repeat Mode is reset, and we receive a `KeyDown` event that matches the last key code, we simply ignore it. ## Validation Steps Performed I've manually tested the `DECARM` functionality in Vttest and confirmed that it's working as expected. Although note that in Windows Terminal this only applies to non-alphanumeric keys for now (e.g. Tab, BackSpace, arrow keys, etc.) I've also added a basic unit test that verifies that repeated key presses are suppressed when the `DECARM` mode is disabled. Closes #13919
claunia added the pull-request label 2026-01-31 09:37:21 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29872