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
In VSCode, I opened a folder with subfolders, each with several python scripts.
I have the setting "python.terminal.executeInFileDir": true but no other settings.
When I run a python file (keybinding to python.execInDedicatedTerminal), it runs
PS C:/mainfolder > cd C:/mainfolder/subfolder1
PS C:/mainfoldersubfolder> & python.exe C:/mainfolder/subfolder1/script1.exe
For each script, a Terminal is opened. If I run a previously run script, it jumps back to the Terminal belonging to that.
The name of the terminals are "Python: script1 subfolder1" (with the last bit in grey), "Python: script2 subfolder1", "Python: script3 subfolder2" etc.
On my Mac, I have the keybinding set to python.execInTerminal-icon and it opens a (separate) terminal directly with
Unlike the windows variant, later calls to python.exec do not repeat the first line.
When I run subfolder1/script2.py, it uses the same terminal and only opens a new one for subfolder2.
The terminal titles are "zsh subfolder1", "zsh subfolder2" etc.
No settings are changed beyond "python.terminal.executeInFileDir": true.
How can I get the same behaviour on my Windows computer (open one terminal per subfolder, not per file)?
I cannot use python.execInTerminal-icon on Windows, because it does not work while I'm in a REPL (it tries cd within the >>> REPL) and it does not open a new terminal in the first place.
The python extension version is 2025.16.0 on both computers.
It is also not solely an OS-issue: a student of mine has the same behaviour (cd first, separate terminal per script instead of subfolder) on his Mac.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In VSCode, I opened a folder with subfolders, each with several python scripts.
I have the setting
"python.terminal.executeInFileDir": truebut no other settings.When I run a python file (keybinding to
python.execInDedicatedTerminal), it runsFor each script, a Terminal is opened. If I run a previously run script, it jumps back to the Terminal belonging to that.
The name of the terminals are "Python: script1 subfolder1" (with the last bit in grey), "Python: script2 subfolder1", "Python: script3 subfolder2" etc.
On my Mac, I have the keybinding set to
python.execInTerminal-iconand it opens a (separate) terminal directly withUnlike the windows variant, later calls to python.exec do not repeat the first line.
When I run
subfolder1/script2.py, it uses the same terminal and only opens a new one forsubfolder2.The terminal titles are "zsh subfolder1", "zsh subfolder2" etc.
No settings are changed beyond
"python.terminal.executeInFileDir": true.How can I get the same behaviour on my Windows computer (open one terminal per subfolder, not per file)?
I cannot use
python.execInTerminal-iconon Windows, because it does not work while I'm in a REPL (it tries cd within the >>> REPL) and it does not open a new terminal in the first place.The python extension version is 2025.16.0 on both computers.
It is also not solely an OS-issue: a student of mine has the same behaviour (cd first, separate terminal per script instead of subfolder) on his Mac.
Beta Was this translation helpful? Give feedback.
All reactions