How to call VS Code Editor from terminal / command line

前端 未结 21 1424
别那么骄傲
别那么骄傲 2020-12-04 06:22

The question says it all.

How can I open VS Code editor from

  • windows cmd
  • linux and mac terminal

e.g. for notepad++ I write

21条回答
  •  一整个雨季
    2020-12-04 06:53

    Sometimes setting path from VS Code command palette does not work

    Instead manually add your VS Code to your path:

    1. Run in terminal

      sudo nano /etc/paths

    2. Go to the bottom of the file, and enter the path you wish to add

    3. Hit control-x to quit. Enter “Y” to save the modified buffer.

    4. Restart your terminal and to test echo $PATH. You should something similar

    ~ echo $PATH /Users/shashank/.nvm/versions/node/v8.9.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin

    Next time, you navigate to your project folder from terminal

    Enter:

    code .

    or

    code /path/to/project

    Source

提交回复
热议问题