on main help sign in
fix(oauth): fix copy to clipboard on terminals that don't support osc52 (#2642)

For example: Apple Terminal.

commite74253ea4f3a9986c1332f48fd51def6798e2c65 authorAndrey Nering <andreynering@users.noreply.github.com> dateFri 17 Apr 2026, 16:55 (6 months ago) parent2f32c9b
1 file changed+4−7
internal/ui/dialog/oauth.go+4−7
internal/ui/dialog/oauth.go+4−7
@@ -350,25 +350,22 @@ func (d *OAuth) copyCode() tea.Cmd {
350350 if d.State != OAuthStateDisplay {
351351 return nil
352352 }
353− return tea.Sequence(
354− tea.SetClipboard(d.userCode),
355− util.ReportInfo("Code copied to clipboard"),
356− )
353+ return common.CopyToClipboard(d.userCode, "Code copied to clipboard")
357354}
358355
359356func (d *OAuth) copyCodeAndOpenURL() tea.Cmd {
360357 if d.State != OAuthStateDisplay {
361358 return nil
362359 }
363− return tea.Sequence(
364− tea.SetClipboard(d.userCode),
360+ return common.CopyToClipboardWithCallback(
361+ d.userCode,
362+ "Code copied and URL opened",
365363 func() tea.Msg {
366364 if err := browser.OpenURL(d.verificationURL); err != nil {
367365 return ActionOAuthErrored{fmt.Errorf("failed to open browser: %w", err)}
368366 }
369367 return nil
370368 },
371− util.ReportInfo("Code copied and URL opened"),
372369 )
373370}
374371