[Bug]: Middle-click closing a right panel tab also pastes the primary selection into the composer on Linux
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start by reading RightPanelTabs.tsx and the terminal's surface.ts handling for middle-button mouse events, then check the related issue #15531 for context. Reproduce on Linux with the composer focused and close a right-panel tab using the middle mouse button. Done means the tab closes without pasting the primary selection into the composer.
Written by the indexing model from the issue text.
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
- On Linux, select some text anywhere so it goes into the primary selection.
- Open two or more right panel tabs, such as PR, browser, or Files.
- Click into the composer so it has focus.
- Without clicking anywhere else, middle-click one of the right panel tabs to close it.
Expected behavior
The tab closes and nothing is pasted into the composer.
Actual behavior
The tab closes, and the primary selection is also pasted into the composer.
This only happens when the composer has focus right before the middle-click. If I first click on an empty area so the composer loses focus, the middle-click only closes the tab. Middle-clicking a tab doesn't move focus, so the paste lands in whatever editable still has it.
This comes up all the time in my daily workflow: I switch back and forth between the composer and the right panel tabs (PR, browser, Files), so the composer almost always has focus when I go to close a tab.
Likely cause: RightPanelTabs.tsx handles middle-click close (added in #3161). It calls preventDefault() on the middle mousedown and in onAuxClick, but never on the middle mouseup. Chromium pastes the primary selection on Linux at mouseup time, before auxclick fires, so the preventDefault() in handleTabAuxClick runs too late to stop it.
The terminal already handles this: surface.ts cancels the middle mouseup on platforms where isMiddleClickPastePlatform() is true (#11018). The tab handler could add a matching onMouseUp that calls preventDefault() when event.button === 1.
Related: #15531 has the same root cause in the chat timeline. A shared fix, such as a document-level capture mouseup guard for middle-clicks that don't land in an editable, would cover both.
Impact
Minor bug or occasional failure
Version or commit
v0.0.46-nightly.20261005.2667
Environment
Linux (Omarchy / Hyprland, Wayland), T3 Code desktop v0.0.46-nightly.20261005.2667
Workaround
Click on an empty area first so the composer loses focus, or close tabs with the × button instead of a middle-click.
[!NOTE]
This issue was generated by Claude Opus 5.5 (high effort).
- Dominant language
- TypeScript
- Stars
- 24.8k
- Forks
- 6.4k
- Avg merge
- 8h 34m
- Merged PRs (30d)
- 243
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pingdotgg/t3code
-
[Bug]: Dead-key apostrophe inserts extra quotes in the composerPossibly taken A pull request linked to this issue is open or already merged. Openbug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
pingdotgg/t3code#16859 · 1 comment ·
Maintainers usually reply within 1 day
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pingdotgg/t3code#16822 · 1 comment ·
Maintainers usually reply within 1 day
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pingdotgg/t3code#16821 · 1 comment ·
Maintainers usually reply within 1 day
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
pingdotgg/t3code#16810 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug]: Antigravity turns fail on NixOS: embedded Python can't verify TLS (empty CA store) -> 502Openbug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pingdotgg/t3code#16742 · 1 comment ·
Maintainers usually reply within 1 day
All issues in pingdotgg/t3code
Similar issues
-
Bump Firebase JS SDK (12.19.0 → 13.0.0)Possibly taken @SelaseKay claimed this today. OpenNeeds Attention type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
invertase/react-native-firebase#9364 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 4 days
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
redhat-developer/rhdh-plugin-export-overlays#4261 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] 官网文档的图片挂了Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
area:cli bug triage:in-progress
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day