microsoft / microsoft/vscode-remote-release
`dev.containers.githubCLILoginWithToken` does not respect host account switching.
@chrmarti is already working on this.
Since Nov 24, 2025.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 469
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
- VSCode Version:1.107.0-insider
- Local OS Version: macOS 26.2 Beta
- Remote OS Version: Ubuntu 24.04.3 LTS
- Remote Extension/Connection Type: Dev Containers
- Logs: None
Steps to Reproduce:
Host Machine
- Log into the GitHub CLI with a personal account
- Log into the GitHub CLI with another account (I use a work account)
- Open VS Code
- Enable the
dev.containers.githubCLILoginWithTokensetting - Clone a repository into a dev container that has GitHub CLI feature.
Remote Machine
- Run
gh api user -q '.login'to see your user name - Stop the dev container
Host Machine
- Run
gh auth switchto change to a different account - Spin up the dev container
Remote Machine
- Run
gh api user -q '.login'
Expected Behavior:
For the username to be the currently active host GitHub CLI account.
Actual Behavior:
The username didn't change.
Work Around
Rebuilding the dev container with the desired account active on the host machine will get it to use the currently active account post rebuild (so switch before rebuilding).
PS: Thanks for this awesome feature! With copilot CLI and GitHub CLI, this is a life saver for having to avoid re-authenticating every new dev container and keep expected tools working. It also enables playing with the Continue in background @cli in dev containers.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.