Run / Open VSCode from Mac Terminal

后端 未结 16 1187
忘了有多久
忘了有多久 2020-12-07 07:01

I\'d like to run / open Visual Studio Code from the Mac OSX Terminal by running this command code .. I found instructions here:

https://code.visualstud

16条回答
  •  甜味超标
    2020-12-07 07:12

    To set up VS code path permanently on Mac OS;

    just open .bash_profile using the following command on terminal

    open -t .bash_profile
    

    Then add the following path to .bash_profile

    code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}
    

    save the .bash_profile file and quit the terminal. Then reopen the terminal and type code .to open VS code.

提交回复
热议问题