Run / Open VSCode from Mac Terminal

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

    I simply created a file called code:

    #!/bin/bash
    
    open /Applications/Visual\ Studio\ Code.app $1
    

    Make it executable:

    $ chmod 755 code
    

    Then put that in /usr/local/bin

    $ sudo mv code /usr/local/bin
    

    As long as the file sits someplace that is in your path you can open a file by just typing: code

提交回复
热议问题