I’ve seen this post, but I don’t know how this could help me. What I want to do is to start the debugger within a Rosetta terminal. What I currently do, is start the script in debug mode till it fails and then I type arch -x86_64 zsh
to enter Rosetta2 emulation. Then I restart the debugger and then it works. How can I tell debugpy to immediately start with a Rosetta2 emulation?
I have added this to my settings.json
:
"terminal.integrated.profiles.osx": {
"x86_64 zsh": {
"path": "arch",
"args": [
"-arch", "x86_64", "zsh"
]
}
}
and I can use this as a normal terminal. But how do I select this for debugpy?
For debugpy within VSCode I switch to the Run and debug
view an create a launch.json
as shown below:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: appName.py",
"type": "python",
"request": "launch",
"program": "/abs/path/to/appName.py",
"console": "integratedTerminal",
"justMyCode": true
}
]
}
Then I hit the start debugging button as shown in this screenshot:
After that a debug terminal opens and fails since it is running on arm64
. If I manually switch this terminal to x86_64
and hit the run and debug button again, it works.
2
Answers
Try the following solution
settings.json
refs
https://code.visualstudio.com/docs/terminal/profiles#_configuring-the-taskdebug-profile
https://code.visualstudio.com/docs/terminal/basics#_terminal-shells
https://code.visualstudio.com/docs/python/debugging#_console
xgqfrms’ answer sounds to me to be on the right track with usage of the
terminal.automationProfile.<platform>
settings, but I’m pretty surearch
needs to be the wrapper program, which I’m assuming would look something more along the lines of this: