Skip to content

copilot CLI does not display device/user code when running /login in VS Code integrated terminal #695

@AAAPYLAAA

Description

@AAAPYLAAA

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

  1. Open VS Code on Windows and use the integrated terminal (e.g., PowerShell).
  2. Run copilot to start its interactive mode.
  3. Enter /login to start authentication.
  4. 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 /login before 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 /login in 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 --version outputs: 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 login in 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions