Skip to content

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

Open
mrexodia wants to merge 1 commit intodevcontainers:mainfrom
mrexodia:windows-cwd-fix
Open

Normalize drive letter to lowercase on Windows to match VSCode#1183
mrexodia wants to merge 1 commit intodevcontainers:mainfrom
mrexodia:windows-cwd-fix

Conversation

@mrexodia
Copy link

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 mrexodia requested a review from a team as a code owner March 24, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant