github / github/copilot-cli

Fix browser login URL wrapping and fallback

Ouverte
#4,400 0 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

area:authentication area:terminal-rendering
Langage dominant
Shell
Étoiles
11.2k
Forks
1.9k
Merge moyen
14 h 16 min
PR mergées (30 j)
6

Description

Describe the bug

The Device Code login flow works as expected: it displays a one-time code and URL, opens the URL automatically, and offers to copy the code to the clipboard when a key is pressed.

The Sign in with your browser (recommended) flow behaves differently. Although it displays a message such as “If your browser didn't open, visit:”, pressing a key does not open the browser. The fallback URL is also difficult or impossible to use in the terminal:

  • The URL is long enough to wrap across terminal lines.
  • Only the beginning of the URL (for example, https://github.com/login/oauth/authorize?) is rendered as a clickable link.
  • The query string containing client_id and the remaining parameters appears after the line break and is neither clickable nor reliably selectable/copied.
  • Resizing the terminal changes the wrapping behavior unpredictably; depending on the width, the URL may appear on one line with its end clipped or wrap inconsistently.

This prevents users from completing browser authentication when automatic browser opening fails.

Affected environment

  • GitHub Copilot CLI
  • Linux under WSL2

Steps to reproduce

  1. Start the GitHub Copilot CLI login flow.
  2. Select Sign in with your browser (recommended).
  3. Observe the fallback message and URL.
  4. Press a key when prompted.
  5. If the browser does not open, try selecting or clicking the displayed URL, then resize the terminal and observe the URL again.

Expected behavior

The browser login flow should use the same browser-opening behavior as the Device Code flow: pressing a key should open the browser automatically.

If automatic browser opening fails, the complete fallback URL should be rendered as one usable clickable link without being split into a non-interactive suffix. The CLI should also provide a final copy-to-clipboard option so users can paste the complete URL into a browser manually.

Additional context

Please preserve the full URL and its query parameters across terminal widths, or otherwise provide a terminal-safe presentation that remains clickable and copyable.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par le flux de connexion de GitHub Copilot CLI et comparez le parcours « Sign in with your browser » avec le flux Device Code. Suivez la présentation de l’URL de fallback selon les différentes largeurs du terminal ; la tâche est terminée lorsqu’une pression sur une touche ouvre le navigateur et qu’une URL de fallback complète reste cliquable et copiable, avec une option finale pour le presse-papiers.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
shell
Domaine
authentication, cli
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.