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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13981
Author: @j4james
Created: 9/13/2022
Status: Merged
Merged: 10/11/2022
Merged by: @carlos-zamora

Base: mainHead: feature-decarm


📝 Commits (2)

  • 0871479 Add support for auto repeat mode.
  • 619e6a0 Add unit test for auto repeat mode.

📊 Changes

5 files changed (+80 additions, -1 deletions)

View changed files

📝 src/terminal/adapter/DispatchTypes.hpp (+1 -0)
📝 src/terminal/adapter/adaptDispatch.cpp (+6 -0)
📝 src/terminal/adapter/ut_adapter/inputTest.cpp (+54 -0)
📝 src/terminal/input/terminalInput.cpp (+15 -0)
📝 src/terminal/input/terminalInput.hpp (+4 -1)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/13981 **Author:** [@j4james](https://github.com/j4james) **Created:** 9/13/2022 **Status:** ✅ Merged **Merged:** 10/11/2022 **Merged by:** [@carlos-zamora](https://github.com/carlos-zamora) **Base:** `main` ← **Head:** `feature-decarm` --- ### 📝 Commits (2) - [`0871479`](https://github.com/microsoft/terminal/commit/087147947df43e8c32049537d9b0ca837a1b34d6) Add support for auto repeat mode. - [`619e6a0`](https://github.com/microsoft/terminal/commit/619e6a098cffc6efdedd601ae2afb5f533d23485) Add unit test for auto repeat mode. ### 📊 Changes **5 files changed** (+80 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/terminal/adapter/DispatchTypes.hpp` (+1 -0) 📝 `src/terminal/adapter/adaptDispatch.cpp` (+6 -0) 📝 `src/terminal/adapter/ut_adapter/inputTest.cpp` (+54 -0) 📝 `src/terminal/input/terminalInput.cpp` (+15 -0) 📝 `src/terminal/input/terminalInput.hpp` (+4 -1) </details> ### 📄 Description 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:37:20 +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#29867