File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
packages/opencode/src/cli/cmd/tui/routes/session Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { useSync } from "@tui/context/sync"
33import { DialogSelect } from "@tui/ui/dialog-select"
44import { useSDK } from "@tui/context/sdk"
55import { useRoute } from "@tui/context/route"
6+ import { Clipboard } from "@tui/util/clipboard"
67import type { PromptInfo } from "@tui/component/prompt/history"
78
89export function DialogMessage ( props : {
@@ -54,6 +55,26 @@ export function DialogMessage(props: {
5455 dialog . clear ( )
5556 } ,
5657 } ,
58+ {
59+ title : "Copy" ,
60+ value : "message.copy" ,
61+ description : "copy message text to clipboard" ,
62+ onSelect : async ( dialog ) => {
63+ const msg = message ( )
64+ if ( ! msg ) return
65+
66+ const parts = sync . data . part [ msg . id ]
67+ const text = parts . reduce ( ( agg , part ) => {
68+ if ( part . type === "text" && ! part . synthetic ) {
69+ agg += part . text
70+ }
71+ return agg
72+ } , "" )
73+
74+ await Clipboard . copy ( text )
75+ dialog . clear ( )
76+ } ,
77+ } ,
5778 {
5879 title : "Fork" ,
5980 value : "session.fork" ,
You can’t perform that action at this time.
0 commit comments