mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 01:03:49 +00:00
fix: make OAuth login URL clickable in terminal
Use OSC 8 hyperlink escape sequence to show 'Click here to login' as a clickable link instead of displaying the raw URL which spans multiple lines and is hard to click in terminals (especially WSL).
This commit is contained in:
parent
c193ef74d2
commit
d42a3d71fe
1 changed files with 3 additions and 2 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue