vscode-docker icon indicating copy to clipboard operation
vscode-docker copied to clipboard

'C:\Program' is not recognized as an internal or external command, operable program or batch file.

Open mdhvg opened this issue 1 year ago • 7 comments

Does this occur consistently? Yes Repro steps:

  1. Run any docker container.
  2. Open the docker tab from Side Bar image
  3. Right click on any running container.
  4. Select either View Logs or Attach Shell image

Error: image

Since I have installed docker in the default install location, C:\Program Files\Docker\Docker\resources\bin\docker.exe the space in Program Files is causing the issue.

The error also occurs when trying to run some npm build commands from the JS debugger

Version: 1.28.0 OS: win32 OS Release: 10.0.19045 Product: Visual Studio Code Product Version: 1.85.2 Language: en

mdhvg avatar Jan 22 '24 14:01 mdhvg

Do you have a value set for the VSCode setting docker.dockerPath?

bwateratmsft avatar Jan 22 '24 14:01 bwateratmsft

Do you have a value set for the VSCode setting docker.dockerPath?

I tried setting it to the same value as in the PATH environment variable, but that caused image

I tried both paths: "C:\Program Files\Docker\Docker\resources\bin\docker.exe" "C:\Program Files\Docker\Docker\resources\bin"

mdhvg avatar Jan 22 '24 14:01 mdhvg

Try resetting the setting to have no value, does the issue still reproduce?

bwateratmsft avatar Jan 22 '24 14:01 bwateratmsft

Try resetting the setting to have no value, does the issue still reproduce?

VS code is able to find docker but, the original issue still reproduces.

mdhvg avatar Jan 22 '24 15:01 mdhvg

It looks like you're using cmd as your shell, does it still happen if you use PowerShell as your shell instead? The relevant setting is terminal.integrated.defaultProfile.windows I believe. This may work as a workaround.

cmd is supported so this should be working, there might be a bug in VSCode because it's supposed to be handling the shell quoting for us in the case of task execution which is what's happening here.

bwateratmsft avatar Jan 22 '24 15:01 bwateratmsft

It looks like you're using cmd as your shell, does it still happen if you use PowerShell as your shell instead? The relevant setting is terminal.integrated.defaultProfile.windows I believe. This may work as a workaround.

cmd is supported so this should be working, there might be a bug in VSCode because it's supposed to be handling the shell quoting for us in the case of task execution which is what's happening here.

Whoa! It worked with PowerShell as default shell.

mdhvg avatar Jan 22 '24 16:01 mdhvg

I'm not able to reproduce in VSCode 1.86.1, can you check if this still repros for you in the latest VSCode?

bwateratmsft avatar Feb 13 '24 16:02 bwateratmsft

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

AzCode-Bot avatar Feb 28 '24 05:02 AzCode-Bot