Fix browser login URL wrapping and fallback
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Shell
- Star
- 11.2k
- Fork
- 1.9k
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
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_idand 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
- Start the GitHub Copilot CLI login flow.
- Select Sign in with your browser (recommended).
- Observe the fallback message and URL.
- Press a key when prompted.
- 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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu từ luồng đăng nhập GitHub Copilot CLI và so sánh đường dẫn „Sign in with your browser“ với luồng Device Code. Theo dõi cách hiển thị URL dự phòng ở các độ rộng terminal; hoàn tất khi nhấn một phím sẽ mở trình duyệt và một URL dự phòng đầy đủ vẫn có thể nhấp và sao chép được, kèm theo tùy chọn cuối cùng để sao chép vào clipboard.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- shell
- Lĩnh vực
- authentication, cli
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100