-
Notifications
You must be signed in to change notification settings - Fork 757
Closed
Description
Description
When running the copilot CLI inside the VS Code integrated terminal (Windows) and entering the interactive session, executing /login does not display the device/user code in the terminal. The browser opens and prompts for a device code to complete the device authorization flow (https://github.com/login/device), but no code is visible in the integrated terminal, preventing completion of the login flow.
Steps to reproduce
- Open VS Code on Windows and use the integrated terminal (e.g., PowerShell).
- Run
copilotto start its interactive mode. - Enter
/loginto start authentication. - The browser opens the device login page and requests a device/user code, but no code appears in the integrated terminal to paste into the page.
Expected behavior
- The CLI should print the device/user code (for example user_code: ABCD-EFGH) or a verification_uri_complete (a full URL including the code) to the terminal in a way that is visible and copyable in the VS Code integrated terminal.
- If the interactive environment cannot print the code directly, provide a fallback: copy the code to the clipboard, print it to VS Code’s Output panel or show a VS Code notification, or document the recommended alternative command (e.g.,
copilot -p "auth login") for retrieving the code in non-interactive mode.
Actual behavior / Impact
- When a user runs the copilot CLI in the VS Code integrated terminal and triggers
/loginbefore their account has been authorized, the browser opens the device login page and requests a device/user code, but no code is shown in the integrated terminal, preventing the user from completing the device authorization flow. After a successful authorization, Copilot CLI in the VS Code integrated terminal will automatically connect to the authorized account; this report concerns the pre-authorization experience only. The reporter is unsure about session/token expiration behavior and therefore did not assert post-authorization persistence.
Environment
- OS: Windows
- VS Code: [please add VS Code version if desired]
- Copilot CLI: 0.0.365 (Commit: 76d0881)
- Terminal: VS Code integrated terminal (PowerShell)
- Repro frequency: consistently reproducible when using
/loginin the integrated terminal
Suggested fixes / improvements
- Ensure the device/user code (and/or verification_uri_complete) is emitted to integrated terminals reliably and is easily copyable.
- Provide an explicit fallback for integrated terminals: auto-copy the code to the clipboard, write it to the Output panel, or display a VS Code notification.
- Document limitations and recommended workarounds for integrated terminal environments in the CLI docs.
Additional info / diagnostics
- Running
copilot --versionoutputs: 0.0.365, Commit: 76d0881 - Integrated terminal type: PowerShell
- Reproducible 100% of the time.
- If needed, I can provide logs or further diagnostics.
Workaround
- Using
gh auth loginin the normal system terminal will let copilot pick up credentials and bypass the device-code login flow in the integrated terminal.
Labels: bug, ux, authentication
Metadata
Metadata
Assignees
Labels
No labels