"code ." command doesn't work to open Visual Studio Code operator from mac terminal I cannot open Visual Studio Code Editor from command line just by typing "code ." in terminal
4 Answers
Launch VS Code
Open View --> Command Palette
Type
shell commandandfind
Shell Command: Install 'code' command in PATH commandand install (for mac)find
Allow Workspace Shell Configurationand install (for linux )Restart the terminal
Go to your folder path and type
code .in terminal.
Visual Code Studio will open with your current folder directory.
Comments
Locate your bash profile with the command 'locate bash_profile'.That file is usually located in '/Users/user_name/.bash_profile'.Once you found the file, insert the following command.
"code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}"
After that, save the file and type the following command in the same directory.
See the attached screenshot for more clarity. enter image description here
$source .bash_profile
