"code ." command doesn't work to open Visual Studio Code operator from mac terminal
Launch VS Code
Open View --> Command Palette
Type
shell command
andfind
Shell Command: Install 'code' command in PATH command
and install (for mac)find
Allow Workspace Shell Configuration
and 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.
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