Skip to content

Add terminal selection copy action#2904

Merged
juliusmarminge merged 9 commits into
pingdotgg:mainfrom
tarik02:feat/terminal-context-menu-copy-upstream-main
Jul 18, 2026
Merged

Add terminal selection copy action#2904
juliusmarminge merged 9 commits into
pingdotgg:mainfrom
tarik02:feat/terminal-context-menu-copy-upstream-main

Conversation

@tarik02

@tarik02 tarik02 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

What Changed

Added "Copy" action to terminal context menu that's shown right after selection.

Why

Currently, copying from terminal requires too many actions:

  1. Select region.
  2. Dismiss context menu (disgusting).
  3. Copy with separate context menu click/ctrl+c/command+c/whatever.

UI Changes

Before:
2026-06-02_08-32_1

After:
2026-06-02_08-32

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk
Localized UI/clipboard behavior in the terminal drawer with no auth or server changes; copy errors are handled in-place.

Overview
Adds a Copy option next to Add to chat on the terminal selection context menu so users can copy without dismissing the menu first.

Copy uses the raw xterm selection text via writeTextToClipboard; Add to chat still uses trimmed, normalized text. Copy failures show as [terminal] system messages in the pane. Menu-open tracking is renamed to selectionActionMenuOpenRef and cleared in a .finally() on contextMenu.show instead of a try/finally around the whole flow.

Reviewed by Cursor Bugbot for commit 5d53eb0. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add copy action to terminal selection context menu

  • Adds a 'Copy' option to the context menu that appears on terminal text selection in ThreadTerminalDrawer.tsx, alongside the existing 'Add to chat' action.
  • 'Copy' writes the raw selection text (preserving CRLF/newlines) to the clipboard; 'Add to chat' continues to use a normalized, trimmed version.
  • Copy errors are surfaced as system messages written directly to the terminal output.
  • Renames selectionActionOpenRef to selectionActionMenuOpenRef to better reflect its role tracking context-menu open state.

Macroscope summarized 5d53eb0.

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 602e3508-7685-4269-8a09-34ee51b4ecc2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Jun 2, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 2, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Adds a Copy action to the terminal selection context menu. Self-contained UI enhancement following existing patterns with proper error handling. The unresolved comment is a code style question, not a functional concern.

You can customize Macroscope's approvability policy. Learn more.

0rdep

This comment was marked as outdated.

0rdep added a commit to 0rdep/t3code that referenced this pull request Jun 3, 2026
@0rdep

0rdep commented Jun 3, 2026

Copy link
Copy Markdown

please disregard my previous approval. It was intended for my fork, and I am not a member of the pingdotgg/t3code team.

@juliusmarminge
juliusmarminge force-pushed the feat/terminal-context-menu-copy-upstream-main branch from cee3070 to 7ebecc8 Compare June 16, 2026 18:17
@macroscopeapp
macroscopeapp Bot dismissed their stale review June 16, 2026 18:18

Dismissing prior approval to re-evaluate 7ebecc8

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 16, 2026
@macroscopeapp
macroscopeapp Bot dismissed their stale review June 19, 2026 05:32

Dismissing prior approval to re-evaluate 948a0cd

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 19, 2026
Comment thread apps/web/src/components/ThreadTerminalDrawer.tsx Outdated
@macroscopeapp
macroscopeapp Bot dismissed their stale review July 18, 2026 08:12

Dismissing prior approval to re-evaluate 820e554

Comment thread apps/web/src/components/ThreadTerminalDrawer.tsx Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 820e554. Configure here.

Comment thread apps/web/src/components/ThreadTerminalDrawer.tsx Outdated
Comment thread apps/web/src/components/ThreadTerminalDrawer.tsx Outdated
Comment thread apps/web/src/components/ThreadTerminalDrawer.tsx Outdated
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jul 18, 2026
Comment on lines +485 to +486
const clicked = await localApi.contextMenu
.show(TERMINAL_SELECTION_ACTION_MENU_ITEMS, nextAction.position)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clicked here does not infer the action ids when it's extracted here? why is it a shared exported module scoedp constant?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, no real problem. Inlined

@macroscopeapp
macroscopeapp Bot dismissed their stale review July 18, 2026 17:29

Dismissing prior approval to re-evaluate 003f7ad

@juliusmarminge
juliusmarminge merged commit 1735e27 into pingdotgg:main Jul 18, 2026
14 checks passed
adamfgr pushed a commit to agriffiths-bots/t3code that referenced this pull request Jul 19, 2026
* Fix dropped events during initial thread snapshot (pingdotgg#4079)

* [codex] fix mobile composer Enter behavior (pingdotgg#3930)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>

* feat: draft hero landing on the index route (pingdotgg#4055)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>

* feat: file explorer mention actions and zoom-aware context menus (pingdotgg#4054)

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>

* fix(web): avoid duplicate mention text on paste

Co-authored-by: codex <codex@users.noreply.github.com>

* fix(mobile): restore iOS home screen branding (pingdotgg#4025)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* perf(client): defer active thread cache writes (pingdotgg#4006)

* Default diffs to working changes (pingdotgg#3974)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* Add Grok to marketing site provider list (pingdotgg#3484)

* Fix reopening existing Diff tab (pingdotgg#3973)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* Fix sending messages during active turns (pingdotgg#3919)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* [codex] Route OpenCode missing-session errors through Effect (pingdotgg#3608)

Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>

* [fix/feat:ui] Show default option badge (pingdotgg#3232)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* [fix/feat:ui] Preserve open-in editor brand colors (pingdotgg#3225)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* fix(web): handle macOS Home and End in composer (pingdotgg#2508)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* Allow failed remote environments to be removed (pingdotgg#4084)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* [codex] canonicalize client timestamps (pingdotgg#4112)

* [fix/feat:ui] Make selected menu checks blue (pingdotgg#3234)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>

* fix(desktop): Validate WSL node version against engine range after probe success (pingdotgg#3621)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* Refresh splash screen and favicon branding (pingdotgg#4120)

* Add terminal selection copy action (pingdotgg#2904)

* fix(sync): reconcile upstream changes with fork-local behaviour

Two merge-introduced incompatibilities from the 20260719 upstream sync:

- Normalizer: upstream's client-timestamp canonicalization (da3c203)
  rewrote bootstrap.createThread.createdAt, which BootstrapTurnStartDispatcher
  uses to fingerprint a replayed bootstrap turn against the thread it already
  created. Every retry would miss that check and create a duplicate thread.
  Keep the client's bootstrap timestamp as the stable identity; the turn-level
  createdAt is still canonicalized.

- ThreadTerminalDrawer: upstream's terminal selection copy action (1735e27)
  passed a Terminal to writeSystemMessage, which this fork narrowed to accept
  a TerminalWriteQueue. Use terminalWriterRef, matching the other call sites.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Co-authored-by: Ishan <ishansachu1@gmail.com>
Co-authored-by: Maxwell Young <maxtheyoung@gmail.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Yordis Prieto <yordis.prieto@gmail.com>
Co-authored-by: Alex <me@pixp.cc>
Co-authored-by: Chris Michael Guzman <67719167+Chrrxs@users.noreply.github.com>
Co-authored-by: Jake Leventhal <jakeleventhal@me.com>
Co-authored-by: Aditya Mer <101453576+Aditya190803@users.noreply.github.com>
Co-authored-by: Wout Stiens <71498452+StiensWout@users.noreply.github.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: ss <69873514+sandersonstabo@users.noreply.github.com>
Co-authored-by: Guilherme Vieira <46866023+GuilhermeVieiraDev@users.noreply.github.com>
Co-authored-by: Noah Zepner <noah@zepner.dev>
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
Co-authored-by: Taras <Taras.Fomin@gmail.com>
Co-authored-by: wizzoapp[bot] <254688279+wizzoapp[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@tarik02
tarik02 deleted the feat/terminal-context-menu-copy-upstream-main branch July 19, 2026 05:34
bcotrim pushed a commit to bcotrim/mognet that referenced this pull request Jul 19, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 20, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 20, 2026
…ngdotgg#4055pingdotgg#4164) (#175)

* feat: draft hero landing on the index route (pingdotgg#4055)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
(cherry picked from commit 1bd2fa2)

* feat: file explorer mention actions and zoom-aware context menus (pingdotgg#4054)

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 4cfec8c)

* fix(web): avoid duplicate mention text on paste

Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 2318e00)

* Default diffs to working changes (pingdotgg#3974)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 38e0bb0)

* Fix reopening existing Diff tab (pingdotgg#3973)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 31caa56)

* Fix sending messages during active turns (pingdotgg#3919)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit d8b12ae)

* [fix/feat:ui] Show default option badge (pingdotgg#3232)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c0e161a)

* [fix/feat:ui] Preserve open-in editor brand colors (pingdotgg#3225)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit e63403f)

* fix(web): handle macOS Home and End in composer (pingdotgg#2508)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit b859a57)

* Allow failed remote environments to be removed (pingdotgg#4084)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 0506508)

* [fix/feat:ui] Make selected menu checks blue (pingdotgg#3234)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 5c66110)

* Add terminal selection copy action (pingdotgg#2904)

(cherry picked from commit 1735e27)

* fix(web): improve dev sidebar backdrop contrast & remove version pills (pingdotgg#4166)

(cherry picked from commit b511227)

* Fix draft banner stack overlap (pingdotgg#4164)

Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 7e1a0d5)

---------

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Co-authored-by: Yordis Prieto <yordis.prieto@gmail.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Jake Leventhal <jakeleventhal@me.com>
Co-authored-by: ss <69873514+sandersonstabo@users.noreply.github.com>
Co-authored-by: Guilherme Vieira <46866023+GuilhermeVieiraDev@users.noreply.github.com>
Co-authored-by: Noah Zepner <noah@zepner.dev>
Co-authored-by: Taras <Taras.Fomin@gmail.com>
Co-authored-by: maria <maria@kuuro.net>
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 20, 2026
…ngdotgg#4055pingdotgg#4164) (#175) (#177)

* feat: draft hero landing on the index route (pingdotgg#4055)




(cherry picked from commit 1bd2fa2)

* feat: file explorer mention actions and zoom-aware context menus (pingdotgg#4054)



(cherry picked from commit 4cfec8c)

* fix(web): avoid duplicate mention text on paste


(cherry picked from commit 2318e00)

* Default diffs to working changes (pingdotgg#3974)


(cherry picked from commit 38e0bb0)

* Fix reopening existing Diff tab (pingdotgg#3973)


(cherry picked from commit 31caa56)

* Fix sending messages during active turns (pingdotgg#3919)


(cherry picked from commit d8b12ae)

* [fix/feat:ui] Show default option badge (pingdotgg#3232)


(cherry picked from commit c0e161a)

* [fix/feat:ui] Preserve open-in editor brand colors (pingdotgg#3225)


(cherry picked from commit e63403f)

* fix(web): handle macOS Home and End in composer (pingdotgg#2508)


(cherry picked from commit b859a57)

* Allow failed remote environments to be removed (pingdotgg#4084)


(cherry picked from commit 0506508)

* [fix/feat:ui] Make selected menu checks blue (pingdotgg#3234)



(cherry picked from commit 5c66110)

* Add terminal selection copy action (pingdotgg#2904)

(cherry picked from commit 1735e27)

* fix(web): improve dev sidebar backdrop contrast & remove version pills (pingdotgg#4166)

(cherry picked from commit b511227)

* Fix draft banner stack overlap (pingdotgg#4164)


(cherry picked from commit 7e1a0d5)

---------

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Co-authored-by: Yordis Prieto <yordis.prieto@gmail.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Jake Leventhal <jakeleventhal@me.com>
Co-authored-by: ss <69873514+sandersonstabo@users.noreply.github.com>
Co-authored-by: Guilherme Vieira <46866023+GuilhermeVieiraDev@users.noreply.github.com>
Co-authored-by: Noah Zepner <noah@zepner.dev>
Co-authored-by: Taras <Taras.Fomin@gmail.com>
Co-authored-by: maria <maria@kuuro.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants