Merge pull request #349 from Cursivez/fix/clickable-oauth-login-link

fix: Make OAuth login URL clickable in terminal
This commit is contained in:
Mario Zechner 2025-12-29 13:34:33 +01:00 committed by GitHub
commit 8ced1131c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1587,8 +1587,9 @@ export class InteractiveMode {
await this.session.modelRegistry.authStorage.login(providerId as OAuthProvider, {
onAuth: (info: { url: string; instructions?: string }) => {
this.chatContainer.addChild(new Spacer(1));
this.chatContainer.addChild(new Text(theme.fg("accent", "Opening browser to:"), 1, 0));
this.chatContainer.addChild(new Text(theme.fg("accent", info.url), 1, 0));
// Use OSC 8 hyperlink escape sequence for clickable link
const hyperlink = `\x1b]8;;${info.url}\x07Click here to login\x1b]8;;\x07`;
this.chatContainer.addChild(new Text(theme.fg("accent", hyperlink), 1, 0));
if (info.instructions) {
this.chatContainer.addChild(new Spacer(1));
this.chatContainer.addChild(new Text(theme.fg("warning", info.instructions), 1, 0));