VSCode from the CLI on MacOS
Like a lot of people, I am now using VS Code as my main editor on Mac OS. And I try to automate my tasks as much as possible, so I create aliases in my Terminal (yes, not something new, but you got the context), including one for VSCoce aka code
.
Did you also got an error doing code .
?
I am using zsh so my aliases should be in ~/.zshrc
but I had an issue and code .
was not opening VS Code but giving me an error like this one zsh: command not found: code
The solution: changing the alias for VS Code
I found the solution on Stackoverflow (here for the curious).
What helped me was:
- Going to VSCode
- Use the
⇧ + ⌘ + P
to open the Command Palette - Select Uninstall 'code' command from PATH
- Instaling it again thanks to Install 'code' command from PATH