Skip to content

Comments

feat(emulator): Implement DECARM - auto-repeat mode#1022

Merged
gdamore merged 1 commit intomainfrom
autorepeat-mode
Jan 28, 2026
Merged

feat(emulator): Implement DECARM - auto-repeat mode#1022
gdamore merged 1 commit intomainfrom
autorepeat-mode

Conversation

@gdamore
Copy link
Owner

@gdamore gdamore commented Jan 28, 2026

Summary by CodeRabbit

  • New Features

    • Added keyboard key repeat control. Users can now enable or disable key repetition through terminal escape sequences, allowing precise control over keystroke behavior when keys are held down.
  • Tests

    • Added test coverage for disabled key repeat functionality.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

📝 Walkthrough

Walkthrough

The pull request adds an AutoRepeat private mode to the terminal emulator that controls key repetition behavior. The emulator now initializes this mode to On, resets it during soft reset, and modifies key repeat logic to conditionally repeat based on this mode state. A test validates disabled key repeat behavior.

Changes

Cohort / File(s) Summary
AutoRepeat Mode Implementation
vt/emulate.go
Added PmAutoRepeat private mode to emulator state, initialized to On in NewEmulator, reset to On during soft reset. Modified repeatRaw to branch: if AutoRepeat is On/OnLocked, repeat key up to 40 times; otherwise, send key once only if repeat count is zero.
Key Repeat Disable Test
vt/tests/key_test.go
Added TestKeyRepeatDisabled to verify that sending escape sequence \x1b[?8l disables key repeating, confirming single key press produces single output instead of multiple repeats.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 A rabbit presses keys with glee,
But now they know to let them be—
When AutoRepeat's flipped to "No,"
One tap becomes one gentle flow! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: implementing DECARM (auto-repeat mode) in the emulator by adding a private mode that controls key repetition behavior.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.99%. Comparing base (720eeab) to head (194d81e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1022      +/-   ##
==========================================
+ Coverage   85.95%   85.99%   +0.03%     
==========================================
  Files          46       46              
  Lines        4834     4840       +6     
==========================================
+ Hits         4155     4162       +7     
+ Misses        528      527       -1     
  Partials      151      151              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gdamore gdamore merged commit 194d81e into main Jan 28, 2026
15 checks passed
@gdamore gdamore deleted the autorepeat-mode branch January 28, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant