You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
set python.terminal.executeInFileDir not working, python file run earlier than cd command #835
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:
close all running terminal
create a folder, and add a py file
print(os.getcwd())
click run python file button
the terminal print the workspace dir, and after execute the py file, the terminal change to the file location.
Diagnostic data
Output for Python in the Output panel (View→Output, 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) $
Activity
anthonykim1 commentedon Sep 13, 2025
Eleanor Boyd (@eleanorjboyd) Does environment extension handle sending commands differently than python extension?
anthonykim1 commentedon Dec 15, 2025
Are folks still experiencing this?
kaala commentedon Dec 16, 2025
Hi, the problem seems fixed in vscode 1.107.0.