Shell/Bash: open visual studio code from terminal mac Example

By

Shell/Bash Example: This is the "open visual studio code from terminal mac" Example. compiled from many sources on the internet by SimpleTutorials.org

open visual studio code from terminal mac

#Add Bash alias in .bash_profile ?
$ alias code="open -a /Applications/Visual\ Studio\ Code.app"

#Open Visual Studio Code by command
$ code .

open vscode from terminal mac

open Visual Studio Code 
press Cmd+shift+p
search for ``Shell command: install 'code' command in PATH.`` and click it
works in terminal
#Open Visual Studio Code by command
$ code .

install code . path in mac

cat << EOF >> ~/.zshrc
# Add Visual Studio Code (code)
export PATH="/Applications/Visual Studio Code.app/Contents/Resources/app/bin:$PATH"
EOF

code in terminal

cat << EOF >> ~/.bash_profile
# Add Visual Studio Code (code)
export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
EOF

how to make visual studio code work with terminal on mac

$ code .

open vs code from terminal

Launch VS Code.
Open the Command Palette (Cmd+Shift+P) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.
Restart the terminal
Navigate to project folder in terminal, 
Type code . press enter


* Summary: This "open visual studio code from terminal mac" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!

Others