From e74253ea4f3a9986c1332f48fd51def6798e2c65 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Fri, 17 Apr 2026 16:55:25 -0300 Subject: [PATCH] fix(oauth): fix copy to clipboard on terminals that don't support osc52 (#2642) For example: Apple Terminal. --- internal/ui/dialog/oauth.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/internal/ui/dialog/oauth.go b/internal/ui/dialog/oauth.go index af54b6befdeb6f3b3465986e6959c6c7618c60c6..5b7eb1cc7f768f001aa544d85570903aea4770b7 100644 --- a/internal/ui/dialog/oauth.go +++ b/internal/ui/dialog/oauth.go @@ -350,25 +350,22 @@ func (d *OAuth) copyCode() tea.Cmd { if d.State != OAuthStateDisplay { return nil } - return tea.Sequence( - tea.SetClipboard(d.userCode), - util.ReportInfo("Code copied to clipboard"), - ) + return common.CopyToClipboard(d.userCode, "Code copied to clipboard") } func (d *OAuth) copyCodeAndOpenURL() tea.Cmd { if d.State != OAuthStateDisplay { return nil } - return tea.Sequence( - tea.SetClipboard(d.userCode), + return common.CopyToClipboardWithCallback( + d.userCode, + "Code copied and URL opened", func() tea.Msg { if err := browser.OpenURL(d.verificationURL); err != nil { return ActionOAuthErrored{fmt.Errorf("failed to open browser: %w", err)} } return nil }, - util.ReportInfo("Code copied and URL opened"), ) }