github / github/copilot-cli

Fix browser login URL wrapping and fallback

オープン
#4,400 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

area:authentication area:terminal-rendering
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

GitHub Copilot CLI のログインフローから始め、「Sign in with your browser」のパスと Device Code フローを比較します。ターミナルの幅に応じたフォールバック URL の表示を追跡します。キーを押すとブラウザーが開き、完全なフォールバック URL が引き続きクリック可能かつコピー可能で、最後にクリップボードのオプションが表示されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
shell
領域
authentication, cli
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。