microsoft / microsoft/vscode-remote-release

`dev.containers.githubCLILoginWithToken` does not respect host account switching.

Open
#11,329 0 comments 0 reactions 1 assignee View on GitHub

@chrmarti is already working on this.

Since Nov 24, 2025.

bug containers
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

  1. Log into the GitHub CLI with a personal account
  2. Log into the GitHub CLI with another account (I use a work account)
  3. Open VS Code
  4. Enable the dev.containers.githubCLILoginWithToken setting
  5. Clone a repository into a dev container that has GitHub CLI feature.

Remote Machine

  1. Run gh api user -q '.login' to see your user name
  2. Stop the dev container

Host Machine

  1. Run gh auth switch to change to a different account
  2. Spin up the dev container

Remote Machine

  1. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.