Holding alt+backspace long press remove extra characters after release (should stop immediately) #2188

Open
opened 2026-02-16 17:34:35 -05:00 by yindo · 3 comments
Owner

Originally created by @adolfousier on GitHub (Oct 20, 2025).

Originally assigned to: @thdxr on GitHub.

Description

Issue: When a backspace is held down for a long press, the system correctly generates a rapid series of deletion events. However, upon releasing the key, the deletion process does not stop immediately and continues to remove characters. The longer the key is held, the more characters are erroneously deleted after release.

Observed: The root cause is that for every repeated key press event generated during the long press, the application queues a corresponding deletion action. When we release the key, the application is still working through this backlog of queued actions. It doesn't acknowledge the "key up" event until this queue is empty, leading to the observed "overshoot" in deletion. The low-level input system correctly reports KeyReleaseEvent and IsRepeat flags, but the higher-level application logic isn't using this information to halt the process.

Fix: The event handling logic must be changed to properly manage actions initiated by a long press.

Instead of blindly queueing an action for every single repeated KeyPressEvent, the application should initiate the deletion on the first press and then continuously process it. Once receiving the KeyReleaseEvent, it must immediately terminate the deletion loop and clear any pending deletion actions related to that key. This ensures the action stops precisely when the user releases the key, fixing the "overshoot" problem.

I've been testing this fix locally and I'm ready to push once approved, thank you!

OpenCode version

v0.15.8 - local built

Steps to reproduce

Write a long text in the input, then long press alt+backspace for 2-3 seconds and release it

Operating System

Ubuntu 25.10

Terminal

Alacritty

Originally created by @adolfousier on GitHub (Oct 20, 2025). Originally assigned to: @thdxr on GitHub. ### Description **Issue:** When a backspace is held down for a long press, the system correctly generates a rapid series of deletion events. However, upon releasing the key, the deletion process does not stop immediately and continues to remove characters. The longer the key is held, the more characters are erroneously deleted after release. **Observed:** The root cause is that for every repeated key press event generated during the long press, the application queues a corresponding deletion action. When we release the key, the application is still working through this backlog of queued actions. It doesn't acknowledge the "key up" event until this queue is empty, leading to the observed "overshoot" in deletion. The low-level input system correctly reports KeyReleaseEvent and IsRepeat flags, but the higher-level application logic isn't using this information to halt the process. **Fix:** The event handling logic must be changed to properly manage actions initiated by a long press. Instead of blindly queueing an action for every single repeated KeyPressEvent, the application should initiate the deletion on the first press and then continuously process it. Once receiving the KeyReleaseEvent, it must immediately terminate the deletion loop and clear any pending deletion actions related to that key. This ensures the action stops precisely when the user releases the key, fixing the "overshoot" problem. **I've been testing this fix locally and I'm ready to push once approved, thank you!** ### OpenCode version v0.15.8 - local built ### Steps to reproduce Write a long text in the input, then long press ```alt+backspace``` for 2-3 seconds and release it ### Operating System Ubuntu 25.10 ### Terminal Alacritty
yindo added the bug label 2026-02-16 17:34:35 -05:00
Author
Owner

@rekram1-node commented on GitHub (Oct 20, 2025):

yeah I think this will be fixed once opentui version of opencode ships this week

@rekram1-node commented on GitHub (Oct 20, 2025): yeah I think this will be fixed once opentui version of opencode ships this week
Author
Owner

@adolfousier commented on GitHub (Oct 20, 2025):

I've fixed this, if need I can push a PR.

https://github.com/user-attachments/assets/b30e1f1a-8ab6-4b0e-8774-544619dd62e3

Thank you. Cheers

@adolfousier commented on GitHub (Oct 20, 2025): I've fixed this, if need I can push a PR. https://github.com/user-attachments/assets/b30e1f1a-8ab6-4b0e-8774-544619dd62e3 Thank you. Cheers
Author
Owner

@rekram1-node commented on GitHub (Oct 20, 2025):

sure pr welcome

@rekram1-node commented on GitHub (Oct 20, 2025): sure pr welcome
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2188