Mona Jalal Mona Jalal - 1 month ago 4x
Node.js Question

What is "code . " for Visual Code Studio

The command "code ." doesn't work in this manual?

All the other steps before that worked. How can I call the Visual Studio in terminal in OSX?

Monas-MacBook-Pro:myExpressApp mona$ pwd
Monas-MacBook-Pro:myExpressApp mona$ code .
-bash: code: command not found

EDIT: I ended up opening it from within Visual Code Studio by changing the workspace but I am wondering why that command "code ." won't work?
enter image description here


Tip: If you want to run VSCode from the terminal, append the following to your .bashrc file

code () {
if [[ $# = 0 ]]
    open -a "Visual Studio Code"
    [[ $1 = /* ]] && F="$1" || F="$PWD/${1#./}"
    open -a "Visual Studio Code" --args "$F"

Then $ source ~/.bashrc