summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-06-19 09:05:41 -0500
committeradamdottv <[email protected]>2025-06-19 09:06:25 -0500
commit4b132656df319d68ac5c88f01fd1bb3dc28f12d8 (patch)
treeefb434d49d1daabcfcc8916e078eefe028bb9420
parent26bab00dabb6d20c9fd80a4873642c4df1b3f4b9 (diff)
downloadopencode-4b132656df319d68ac5c88f01fd1bb3dc28f12d8.tar.gz
opencode-4b132656df319d68ac5c88f01fd1bb3dc28f12d8.zip
feat(tui): copy share url to clipboard
-rw-r--r--packages/tui/internal/tui/tui.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/tui/internal/tui/tui.go b/packages/tui/internal/tui/tui.go
index d7cf2f600..6e052efff 100644
--- a/packages/tui/internal/tui/tui.go
+++ b/packages/tui/internal/tui/tui.go
@@ -398,12 +398,16 @@ func (a appModel) executeCommand(command commands.Command) (tea.Model, tea.Cmd)
if a.app.Session.Id == "" {
return a, nil
}
- a.app.Client.PostSessionShareWithResponse(
+ response, _ := a.app.Client.PostSessionShareWithResponse(
context.Background(),
client.PostSessionShareJSONRequestBody{
SessionID: a.app.Session.Id,
},
)
+ if response.JSON200 != nil && response.JSON200.Share != nil {
+ shareUrl := response.JSON200.Share.Url
+ cmds = append(cmds, tea.SetClipboard(shareUrl))
+ }
case commands.SessionInterruptCommand:
if a.app.Session.Id == "" {
return a, nil