You may have both stable and insiders releases of Visual Studio Code installed. If you're like me, you'll end up trying to open a file with the code command when you meant code-insiders. This little edit makes it so that the code script knows that and opens it in the right place for you.
- Make sure to have installed the
codeandcode-insiderscommand into your path by using the command palette - Edit the
codecommand (e.g.code "$(which code)") - Add the following to the script, after the remote terminal handling but before everything else:
IS_VS_CODE_RUNNING="$(test "$(ps aux | grep "/[A]pplications/Visual Studio Code.app/Contents/MacOS/Electron")" && echo 1 || echo 0)"
IS_VS_CODE_INSIDERS_RUNNING="$(test "$(ps aux | grep "/[A]pplications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron")" && echo 1 || echo 0)"