Skip to content

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

Closed

Description

@adolfousier

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

Activity

  1. rekram1-node commented on Oct 20, 2025

    @rekram1-node
    Contributor

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

  2. adolfousier commented on Oct 20, 2025

    @adolfousier
    Author

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

    Screencast.From.2025-10-20.21-57-57.mp4

    Thank you. Cheers

  3. rekram1-node commented on Oct 20, 2025

    @rekram1-node
    Contributor

    sure pr welcome

  4. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions