SOLVED: Code Command Not Working in Terminal to Open VS Code

Last updated on 5 Dec, 2022

If I need to open a file or folder in Visual Studio Code, I use code command. It was working fine for long. All of a sudden, it stopped working.


The exact reason why it stopped working, I am not sure. I doubt it has something to do with VS code software update.


Every time when I get this issue below solution worked for me.

Click Shift+Cmd+P to open the command pallete.

Search for Shell command: Uninstall code command from PATH. Run that command. It will remove the code command from PATH.

Then, search for Shell command: Install code command in PATH. It will install it again.

For uninstalling and installing, it will ask your root permissions.

After that the code command starts working from any terminal.

--- ○ ---
Joby Joseph
Web Architect