Option "execute in file dir" ignored when use play button "debug python file in terminal"
See original GitHub issueEnvironment data
- VS Code version: 1.61.0
- Extension version: 2021.10.1317843341
- OS and version: 10.0.19043.1237
- Python version: 3.8.8 Anaconda
- Type of virtual environment used: conda
- Value of the
python.languageServer
setting: default
Expected behaviour
When debugging python file in terminal, it should use the option to “execute the file in the file’s directory, instead of the current open folder” (setting "python.terminal.executeInFileDir": true
)
It is ok when choose “run python file in terminal”. It should do the same when debugging.
Actual behaviour
“Debug python file in terminal” (with the same “play button” used to “run python file in terminal”) ignores the setting "python.terminal.executeInFileDir": true
Steps to reproduce:
Try to “debug python file in the terminal” with the same “play button” used to “run python file in terminal”.
It leads to error specially when leading with local files in debugging, which worked fine when running.
See bellow running and debugging the same file, in the same folder.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Debugging configurations for Python apps in Visual Studio Code
To initialize debug configurations, first select the Run view in the sidebar: ... Two common options are to use the Python File configuration...
Read more >[BUG] Debugging with purpose ignored in user/workspace ...
It would be great to configure run/debug button for loose files: If file is in workspace but there is no launch.json : use...
Read more >Debugger Not Stopping at Breakpoints in VS Code for Python
Right-click VS Code icon, choose "Run as Administrator. ... breakpoints on any Python file, even outside of your Python project's directory; ...
Read more >Python in VSCode: Running and Debugging
How to use Python in VSCode. Learn how to run and debug your code, use VSCode with a Python virtualenv, and select the...
Read more >Command line usage — Coverage.py 6.4.4 documentation
run – Run a Python program and collect execution data. ... Any command can use a configuration file by specifying it with the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Diogo-Rossi As a work around you can add debug configuration to launch json:
I had tried everything that I could find via Google to get this to work. I was about to write that it didn’t work for me, but I realized that there was the additional “purpose” line. I added that and it now seems to be working - my print(os.getcwd()) is for the file’s directory now when I do debug.