How to run VSCode Integrated Terminal in x86_64 on Apple M1 (arm64)?

Solution 1:

I fiddled with trying to add another shell, etc, but found the easiest thing was to update your shell config to look for vscode. Once a zsh session loads and detects you are in the Integrated vscode Terminal, it will launch another shell within the arch

Add this to your ~/.zshrc or whatever shell config you are using:

# simulates iTerm i386 within VSCode Integrated Terminal
if [[ $TERM_PROGRAM == "vscode" ]] && [[ $(arch) == "arm64" ]];
then
  exec arch -x86_64 $SHELL
fi

# you may notice if you exit the terminal an abrupt 127 error, but shouldn't be an issue.