What do you want to change?
Improve device-code login by allowing providers to opt into opening the verification page and by copying the user code to the clipboard on a best-effort basis.
GitHub Copilot would opt into opening the browser, while other device-code providers would remain headless by default. The verification URL and user code would continue to be displayed in the terminal.
Why?
I use Copilot through my company account and need to log in frequently because of our VPN setup. The current flow requires opening the link, returning to the terminal, and manually copying the code.
GitHub does not provide verification_uri_complete, so the code cannot be prefilled in the URL. Opening the verification page and copying the code would reduce the flow to a single paste.
How? (optional)
Add an optional autoOpenBrowser flag to device-code auth events and enable it for GitHub Copilot. In showDeviceCode(), open the browser only when that flag is set and attempt to copy the user code to the clipboard.
Browser and clipboard failures should not interrupt login. Show the copied hint only after the clipboard helper reports success.
I would like to implement this myself and already have a local patch with focused tests. I am also open to making automatic copying opt-in if overwriting the current clipboard is a concern.
What do you want to change?
Improve device-code login by allowing providers to opt into opening the verification page and by copying the user code to the clipboard on a best-effort basis.
GitHub Copilot would opt into opening the browser, while other device-code providers would remain headless by default. The verification URL and user code would continue to be displayed in the terminal.
Why?
I use Copilot through my company account and need to log in frequently because of our VPN setup. The current flow requires opening the link, returning to the terminal, and manually copying the code.
GitHub does not provide
verification_uri_complete, so the code cannot be prefilled in the URL. Opening the verification page and copying the code would reduce the flow to a single paste.How? (optional)
Add an optional
autoOpenBrowserflag to device-code auth events and enable it for GitHub Copilot. InshowDeviceCode(), open the browser only when that flag is set and attempt to copy the user code to the clipboard.Browser and clipboard failures should not interrupt login. Show the copied hint only after the clipboard helper reports success.
I would like to implement this myself and already have a local patch with focused tests. I am also open to making automatic copying opt-in if overwriting the current clipboard is a concern.