Skip to content

Normalize drive letter to lowercase on Windows to match VSCode - #1183

Merged
Abdurrahmaan Iqbal (abdurriq) merged 3 commits into
devcontainers:mainfrom
mrexodia:windows-cwd-fix
Apr 8, 2026
Merged

Abdurrahmaan Iqbal (abdurriq) merged 3 commits into
devcontainers:mainfrom
mrexodia:windows-cwd-fix

Conversation

@mrexodia

Copy link
Copy Markdown
Contributor

On macos I use devcontainer exec with my agents to run commands inside of my VSCode devcontainer and this works very well. On Windows there is a mismatch between the devcontainer.local_folder produced by VSCode and by this CLI. It manifests as 'Dev container not found':

C:\CodeBlocks\remill>devcontainer exec --workspace-folder "c:\CodeBlocks\remill" /bin/ls
ACKNOWLEDGEMENTS.md  DoFLD1_llvm19.ll  aarch32_BasicBlock_m32.cpp.bc  build                  flake.lock      fld1_pre.ll         packaging
CLAUDE.md            Dockerfile        aarch32_BasicBlock_m32.cpp.ll  build-container        flake.nix       fld1_pre_llvm17.ll  patches
CMakeLists.txt       Dockerfile.llvm   aarch32_BasicBlock_m64.cpp.bc  cmake                  fld1.ll         fld1_pre_llvm19.ll  scripts
CMakePresets.json    Doxyfile          aarch32_BasicBlock_m64.cpp.ll  daax-instructions.txt  fld1_fix.ll     generated           test-failure.log
CODEOWNERS           LICENSE           aarch64.ll                     dependencies           fld1_llvm17.ll  include             test_runner_lib
DoFLD1_llvm17.ll     README.md         bin                            docs                   fld1_llvm19.ll  lib                 tests

What's next:
    Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug 34526c67c6a0a006ce3e7a1dbe6abfc7eaf265a393224142adc6aaeb0f21bc3a
    Learn more at https://docs.docker.com/go/debug-cli/

C:\CodeBlocks\remill>devcontainer exec --workspace-folder "C:\CodeBlocks\remill" /bin/ls
[1097 ms] Error: Dev container not found.
    at wg (C:\Users\Admin\AppData\Roaming\npm\node_modules\@devcontainers\cli\dist\spec-node\devContainersSpecCLI.js:471:1096)
    at ZQ (C:\Users\Admin\AppData\Roaming\npm\node_modules\@devcontainers\cli\dist\spec-node\devContainersSpecCLI.js:669:6405)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async WZ (C:\Users\Admin\AppData\Roaming\npm\node_modules\@devcontainers\cli\dist\spec-node\devContainersSpecCLI.js:669:3985)
    at async C:\Users\Admin\AppData\Roaming\npm\node_modules\@devcontainers\cli\dist\spec-node\devContainersSpecCLI.js:483:1188

C:\CodeBlocks\remill>

Log when starting the devcontainer from VSCode:

[6780 ms] Running Dev Containers CLI:   run-user-commands --user-data-folder c:\Users\Admin\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --container-session-data-folder /tmp/devcontainers-21768841-b3f2-4f85-b81b-27bf88cd2d361774379668858 --workspace-folder c:\CodeBlocks\remill --id-label devcontainer.local_folder=c:\CodeBlocks\remill --id-label devcontainer.config_file=c:\CodeBlocks\remill\.devcontainer\devcontainer.json --container-id 34526c67c6a0a006ce3e7a1dbe6abfc7eaf265a393224142adc6aaeb0f21bc3a --log-level debug --log-format json --config c:\CodeBlocks\remill\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --skip-non-blocking-commands false --prebuild false --stop-for-personalization true --remote-env REMOTE_CONTAINERS_IPC=/tmp/vscode-remote-containers-ipc-db066b44-42b6-41d2-8a5c-e360905ced47.sock --remote-env SSH_AUTH_SOCK=/tmp/vscode-ssh-auth-db066b44-42b6-41d2-8a5c-e360905ced47.sock --remote-env DISPLAY=:0 --remote-env REMOTE_CONTAINERS_DISPLAY_SOCK=/tmp/.X11-unix/X0 --remote-env REMOTE_CONTAINERS=true --mount-workspace-git-root --terminal-columns 139 --terminal-rows 14 --dotfiles-target-path ~/dotfiles
[6780 ms] Start: Run: C:\Users\Admin\AppData\Local\Programs\Microsoft VS Code\Code.exe c:\Users\Admin\.vscode\extensions\ms-vscode-remote.remote-containers-0.447.0\dist\spec-node\devContainersSpecCLI.js run-user-commands --user-data-folder c:\Users\Admin\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --container-session-data-folder /tmp/devcontainers-21768841-b3f2-4f85-b81b-27bf88cd2d361774379668858 --workspace-folder c:\CodeBlocks\remill --id-label devcontainer.local_folder=c:\CodeBlocks\remill --id-label devcontainer.config_file=c:\CodeBlocks\remill\.devcontainer\devcontainer.json --container-id 34526c67c6a0a006ce3e7a1dbe6abfc7eaf265a393224142adc6aaeb0f21bc3a --log-level debug --log-format json --config c:\CodeBlocks\remill\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --skip-non-blocking-commands false --prebuild false --stop-for-personalization true --remote-env REMOTE_CONTAINERS_IPC=/tmp/vscode-remote-containers-ipc-db066b44-42b6-41d2-8a5c-e360905ced47.sock --remote-env SSH_AUTH_SOCK=/tmp/vscode-ssh-auth-db066b44-42b6-41d2-8a5c-e360905ced47.sock --remote-env DISPLAY=:0 --remote-env REMOTE_CONTAINERS_DISPLAY_SOCK=/tmp/.X11-unix/X0 --remote-env REMOTE_CONTAINERS=true --mount-workspace-git-root --terminal-columns 139 --terminal-rows 14 --dotfiles-target-path ~/dotfiles

This patch makes the CLI match VSCode so that things behave as expected. It might be desirable to eventually perform a fully case-insensitive matching on appropriate filesystems, but this will fix the issue for now without opening that can of worms.

@mrexodia

Copy link
Copy Markdown
Contributor Author

Abdurrahmaan Iqbal (@abdurriq) Christof Marti (@chrmarti) would it be possible to approve the workflows?

@abdurriq

Copy link
Copy Markdown
Contributor

Duncan Ogilvie (@mrexodia) Approved workflows to run, will review too shortly.

@mrexodia

Copy link
Copy Markdown
Contributor Author

Looks like there were some flaky tests hitting ghcr.io with low timeouts. I reproduced the failures locally with a delay proxy script (pi session if you're interested). I know this is unrelated to the actual fix, but I saw it affects other PRs too so figured I fix it here. If you want me to open a separate PR or cherry pick it yourself that's also fine. Could you approve another CI run Abdurrahmaan Iqbal (@abdurriq)?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for contributing this fix. Added a couple nit comments, and approved; up to you if you would like to address them.

Comment thread src/spec-node/utils.ts Resolved
Comment thread src/spec-node/utils.ts Resolved
@mrexodia

Copy link
Copy Markdown
Contributor Author
@abdurriq
Abdurrahmaan Iqbal (abdurriq) merged commit 85a61a0 into devcontainers:main Apr 8, 2026
24 checks passed
@mrexodia
Duncan Ogilvie (mrexodia) deleted the windows-cwd-fix branch April 8, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants