Skip to content

set python.terminal.executeInFileDir not working, python file run earlier than cd command #25024

Open
@kaala

Description

@kaala

Behaviour

I expect set python.terminal.executeInFileDir=true will let run python file command run under the file dir, but the terminal is first execute the python file, then change to file dir.
the button is not working on the first run.

PS, report bug is also not working.
report bug jump to a instruction page, instruct to create bug from vscode.
but from vscode, click preview button jump to issue template select dialog.
loop forever.

Steps to reproduce:

  1. close all running terminal
  2. create a folder, and add a py file
  3. print(os.getcwd())
  4. click run python file button
  5. the terminal print the workspace dir, and after execute the py file, the terminal change to the file location.

Image

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

import os
print("current dir", os.getcwd())
source /workspace/runner/venv/bin/activate
root ➜ /workspace/runner (master) $ source /workspace/runner/venv/bin/activate
(venv) root ➜ /workspace/runner (master) $ /workspace/runner/venv/bin/python -B /workspace/runner/demo/r.py
cd /workspace/runner/demo
current dir /media/workspace/runner
(venv) root ➜ /workspace/runner (master) $ cd /workspace/runner/demo
(venv) root ➜ /workspace/runner/demo (master) $ 

Metadata

Metadata

Assignees

Labels

area-terminalbugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions