VSCode Shell Commands not retaining install status in $PATH after restart
After you download VSCode and add it to your PATH, you may stumble upon a problem where you cannot launch VSCode from the command line or Terminal — it’s as if something modifies your system PATH and takes out the VSCode entry.
I was having the same problem, but unlike @benday, I was running VS Code from /Applications (not from ~/Downloads). Turns out I still had the
quarantineattribute set on VS Code – probably because I had moved it from ~/Downloads to /Applications using mv instead of Finder. Only moving it using Finder removes the quarantine attribute.
To fix the issue, I followed the instructions in #48124 (comment) and ran:
xattr -dr com.apple.quarantine /Applications/Visual\ Studio\ Code.app
IMO since this seems to cause confusion, VS Code should show a warning if “Shell Command: Install ‘code’ command in PATH” is invoked when running from a read-only file system, as in Squirrel/Squirrel.Mac#186. Even better would be to offer the user to fix it for them.