Environment data
- VS Code version: 1.51.1
- Extension version (available under the Extensions sidebar): 2020.11.358366026
- OS and version: Windows 10.0.19042
- Python version (& distribution if applicable, e.g. Anaconda): Anaconda Python 3.6.12 64-bit
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
- Relevant/affected Python packages and their versions: NA
- Relevant/affected Python-related VS Code extensions and their versions: NA
- Value of the
python.languageServer setting: Pylance
Expected behaviour
Expect that if the file directory is on a different drive to the working directory and "python.terminal.executeInFileDir" is set to true, that the terminal will change drive, then change directory, then run python file
Actual behaviour
Terminal opens, changes directory and then runs python file
Steps to reproduce:
- Have python.terminal.executeInFileDir = True
- Open python file on drive other than working directory
- Run python file in terminal
Terminal will open, run the 'cd FileDir' command but not change drive, and then run the python file
Related Code
Related code appears to be in terminalCodeExecution.ts
if ((!wkspace || fileDirPath !== wkspace.uri.fsPath) && fileDirPath.length > 0) { await this.getTerminalService(file).sendText(`cd ${fileDirPath.fileToCommandArgument()}`); }
Environment data
python.languageServersetting: PylanceExpected behaviour
Expect that if the file directory is on a different drive to the working directory and "python.terminal.executeInFileDir" is set to true, that the terminal will change drive, then change directory, then run python file
Actual behaviour
Terminal opens, changes directory and then runs python file
Steps to reproduce:
Terminal will open, run the 'cd FileDir' command but not change drive, and then run the python file
Related Code
Related code appears to be in terminalCodeExecution.ts
if ((!wkspace || fileDirPath !== wkspace.uri.fsPath) && fileDirPath.length > 0) { await this.getTerminalService(file).sendText(`cd ${fileDirPath.fileToCommandArgument()}`); }