Environment data
- VS Code version: 1.22.2
- Extension version (available under the Extensions sidebar): 2018.3.1
- OS and version: Windows 10
- Python version (& distribution if applicable, e.g. Anaconda): Anaconda 5.1.0
Actual behavior
For activation of an environment with whitespaces in the path the extension executes a line of the form
& cmd /k ""C:/Program Files (x86)/.../activate.bat" & powershell"
in the PowerShell terminal. The dots are placeholders. This way the first two quotes are treated as an empty string and the command can not be parsed by cmd.exe.
Expected behavior
The nested quotes need to be properly escaped. For example by doubling the inner quotes:
& cmd /k """C:/Program Files (x86)/.../activate.bat"" & powershell"
or by making the outer quotes single quotes:
& cmd /k '"C:/Program Files (x86)/.../activate.bat" & powershell'
both of which would be proper ways to deal with nested quotes in PowerShell and lead to the desired execution of activation.bat.
Steps to reproduce:
- Install an Anaconda distribution under a path that contains directories with whitespaces in their names
- Select this distribution as Python interpreter in VS Code with Python Extension and default settings
- call ">Python: Create Terminal"
Environment data
Actual behavior
For activation of an environment with whitespaces in the path the extension executes a line of the form
& cmd /k ""C:/Program Files (x86)/.../activate.bat" & powershell"in the PowerShell terminal. The dots are placeholders. This way the first two quotes are treated as an empty string and the command can not be parsed by cmd.exe.
Expected behavior
The nested quotes need to be properly escaped. For example by doubling the inner quotes:
& cmd /k """C:/Program Files (x86)/.../activate.bat"" & powershell"or by making the outer quotes single quotes:
& cmd /k '"C:/Program Files (x86)/.../activate.bat" & powershell'both of which would be proper ways to deal with nested quotes in PowerShell and lead to the desired execution of activation.bat.
Steps to reproduce: