Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug]: Terminal paste lands twice in Chromium browsers (inverse of the #8457 race)

Open Beginner friendly
#13,346 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Domain
cli, web-dev

Research direction

The bug is in apps/web/src/terminal/ghostty/surface.ts, where pasteShortcutToken handles the race between navigator.clipboard.readText() and the native paste event. Start by examining the paste handling logic and the reference commit. Write a test to verify that pasted text is not duplicated, then implement the fix to drop the matching native paste after a successful read. Ensure a keydown clears the record to avoid swallowing later pastes.

Written by the indexing model from the issue text.

Description

accepted bug via-triage

In the web client (Brave, over the network), pasting into the integrated terminal often sends the text twice. I hit it constantly.

The paste shortcut starts navigator.clipboard.readText() and keeps the native paste event as a fallback (apps/web/src/terminal/ghostty/surface.ts). pasteShortcutToken only handles the native event arriving first. If the read resolves first, the native paste that follows is also sent. This is the "remaining inverse ordering" noted when #8457 was closed.

I have a small fix with a regression test in my fork: the read records the text it delivered, and the matching native paste from the same gesture is dropped. Any keydown clears the record, so a later paste is never swallowed. Reference commit: https://github.com/r4iju/t3code/commit/de8ff28dcb4fc3c1b15374d6e9c5531cb3a9a61c

Happy to open a PR if you want it.

Dominant language
TypeScript
Stars
23.5k
Forks
6.1k
Avg merge
9h
Merged PRs (30d)
349

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pingdotgg/t3code

All issues in pingdotgg/t3code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.