ITerm2 se puede programar con Python
Cuando ejecuto Python REPL o Python script a través del menú iTerm2 Scripting en la arquitectura Apple Sillicon (M2 en mi caso) termina con el siguiente error:
Bad CPU type
como en este ejemplo stacktrace:
2-3, 2:43:17.371 PM: /opt/homebrew/bin/zsh -c /Applications/iTerm.app/Contents/Resources/it2\_api\_wrapper.sh /Users/zxaos/.config/iterm2/AppSupport/iterm2env-3.7/versions/3.7.9/bin/python3 /Users/zxaos/.config/iterm2/AppSupport/Scripts/AutoLaunch/iTerm-DarkLight.py
12-3, 2:43:17.381 PM: + unset PYTHONPATH
12-3, 2:43:17.381 PM: + export PYTHONUNBUFFERED=1
12-3, 2:43:17.381 PM: + PYTHONUNBUFFERED=1
12-3, 2:43:17.381 PM: + /Users/zxaos/.config/iterm2/AppSupport/iterm2env-3.7/versions/3.7.9/bin/python3 /Users/zxaos/.config/iterm2/AppSupport/Scripts/AutoLaunch/iTerm-DarkLight.py
12-3, 2:43:17.381 PM: /Applications/iTerm.app/Contents/Resources/it2\_api\_wrapper.sh: line 6: /Users/zxaos/.config/iterm2/AppSupport/iterm2env-3.7/versions/3.7.9/bin/python3: Bad CPU type in executable
12-3, 2:43:17.382 PM:
12-3, 2:43:17.382 PM: \*\* Script exited with status 126 \*\*
¿Cómo resolverlo?