summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoropencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>2025-11-16 15:35:05 -0600
committerGitHub <[email protected]>2025-11-16 15:35:05 -0600
commit832be6e7eb2bb054ae2d71bbf03abeff17e8da6c (patch)
tree3ea691df191abb2e2307c92cdab89da139797406
parent8ba48ed71d6b6164e66c37f250c8efb5a28e6aa7 (diff)
downloadopencode-832be6e7eb2bb054ae2d71bbf03abeff17e8da6c.tar.gz
opencode-832be6e7eb2bb054ae2d71bbf03abeff17e8da6c.zip
Added copy option to message context menu (#4389)
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <[email protected]> Co-authored-by: GitHub Action <[email protected]>
-rw-r--r--packages/opencode/src/cli/cmd/tui/routes/session/dialog-message.tsx21
-rw-r--r--packages/plugin/package.json2
-rw-r--r--packages/sdk/js/package.json2
3 files changed, 23 insertions, 2 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/dialog-message.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/dialog-message.tsx
index a59fad7b1..07e1a1eb4 100644
--- a/packages/opencode/src/cli/cmd/tui/routes/session/dialog-message.tsx
+++ b/packages/opencode/src/cli/cmd/tui/routes/session/dialog-message.tsx
@@ -3,6 +3,7 @@ import { useSync } from "@tui/context/sync"
import { DialogSelect } from "@tui/ui/dialog-select"
import { useSDK } from "@tui/context/sdk"
import { useRoute } from "@tui/context/route"
+import { Clipboard } from "@tui/util/clipboard"
import type { PromptInfo } from "@tui/component/prompt/history"
export function DialogMessage(props: {
@@ -55,6 +56,26 @@ export function DialogMessage(props: {
},
},
{
+ title: "Copy",
+ value: "message.copy",
+ description: "copy message text to clipboard",
+ onSelect: async (dialog) => {
+ const msg = message()
+ if (!msg) return
+
+ const parts = sync.data.part[msg.id]
+ const text = parts.reduce((agg, part) => {
+ if (part.type === "text" && !part.synthetic) {
+ agg += part.text
+ }
+ return agg
+ }, "")
+
+ await Clipboard.copy(text)
+ dialog.clear()
+ },
+ },
+ {
title: "Fork",
value: "session.fork",
description: "create a new session",
diff --git a/packages/plugin/package.json b/packages/plugin/package.json
index 43002ca62..b2a3c93f6 100644
--- a/packages/plugin/package.json
+++ b/packages/plugin/package.json
@@ -24,4 +24,4 @@
"typescript": "catalog:",
"@typescript/native-preview": "catalog:"
}
-} \ No newline at end of file
+}
diff --git a/packages/sdk/js/package.json b/packages/sdk/js/package.json
index 88658a1e6..d2b5e444e 100644
--- a/packages/sdk/js/package.json
+++ b/packages/sdk/js/package.json
@@ -26,4 +26,4 @@
"publishConfig": {
"directory": "dist"
}
-} \ No newline at end of file
+}