Skip to content

Dictation leaves the transcript on the clipboard for 500 ms, so an immediate Cmd+V pastes the transcript again #168

Closed as not planned

Description

@mrsage-AI

Symptom

Dictate, then immediately Cmd+V in the target app (the common "say a prompt, then paste a screenshot/copied text" move) and you get the transcript pasted again instead of your clipboard content. Constantly reproduces; survived every update from 2.1.x through current.

Cause (source-read, current main)

Dictation delivery is clipboard-only: write transcript to NSPasteboard -> post cmd-V -> thread::sleep(Duration::from_millis(500)) -> restore the previous pasteboard snapshot. src/paste.rs around lines 296-331.

So for ~500 ms after every dictation the user's clipboard is the transcript. Any paste in that window pastes the transcript, and it is not a "Hex double-pastes" bug — Hex posts exactly one cmd-V.

src/paste.rs:305        thread::sleep(Duration::from_millis(500));
src/paste.rs:317        if restore.last_change_count != Some(clipboard.changeCount()) { restore.original = None; ... }

The change-count guard (added for "clipboard changed while HEX was preserving it") only fixes the inverse case -- a copy made inside the window no longer gets rolled back. It does not close the window itself.

Evidence from a real machine (2.1.25, ~5200 dictations):

  • process.log: every dictation reports paste_ms=112-120, i.e. the 500 ms restore sleep happens after the reported paste.
  • live.ndjson: exactly one repasted event within 1.5 s of a pasted event across the whole log, i.e. Hex is not re-pasting; the second paste is the user's own.
  • No could not restore clipboard after paste / clipboard changed while warnings, so restores are succeeding.

Ask (primary): a setting for this

Give the clipboard hold a control, any of these would fix it:

  1. restore clip delay setting (e.g. 0-1000 ms) so the transcript leaves the clipboard immediately instead of after 500 ms.
  2. A toggle to skip the clipboard entirely for dictation and insert via the existing keyboard::type_text() (CGEvent unicode typing, already used for personal commands in src/commands.rs) -- no pasteboard involvement at all.
  3. Failing a setting, at least document that the transcript owns the clipboard for 500 ms after each paste.

I'm happy to open a PR for whichever direction is acceptable, including 1 and 2.

Activity

  1. thdxr commented on Oct 28, 2026

    @thdxr
    Member

    Thanks for reporting this! We're working on a brand-new version of Hex (rebuilt from the ground up), and it'll be out soon. This issue is about the current release, so we're closing it to keep the tracker focused on the new version. You can try the new dev build now — download links are in the README: https://github.com/anomalyco/hex#install-hex. If this still happens on the dev build, please open a new issue (or reply here) and we'll take a look.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions