Run / Open VSCode from Mac Terminal

后端 未结 16 1197
忘了有多久
忘了有多久 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:34

    I prefer to have symlinks in the home directory, in this case at least. Here's how I have things setup:

    : cat ~/.bash_profile | grep PATH
    # places ~/bin first in PATH
    export PATH=~/bin:$PATH
    

    So I symlinked to the VSCode binary like so:

    ln -s /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code ~/bin/code
    

    Now I can issue code . in whichever directory I desire.

提交回复
热议问题