How to open Visual Studio Code from the command line on OSX?

后端 未结 24 1124
日久生厌
日久生厌 2020-11-30 16:20

The docs mention an executable called code, but I\'m not sure where I can find that so I can put it on my path. The zip I downloaded from the VSCode site did no

相关标签:
24条回答
  • 2020-11-30 17:07

    Try this one

    Open Visual Studio Code and press Command + Shift + P then type Shell in command palette now you are able to find this option like Shell Command : Install code in PATH from suggested list in command palette. Select that options.

    Open VSCode via Terminal/Command Prompt

    That's it.

    Now open your terminal type.

    $ code .

    0 讨论(0)
  • 2020-11-30 17:08

    If you install Your vs code in Download folder you need to move the VS code to Application folder then open the vs code ,then press shift + command + p after you will see the below image. Then you need to type code . Now you are good to go.

    0 讨论(0)
  • 2020-11-30 17:08

    I discovered a neat workaround for mingw32 (i.e. for those of you using the version of bash which is installed by git-scm.com on windows):

    code () { VSCODE_CWD="$PWD" cmd //c code $* ;}
    
    0 讨论(0)
  • 2020-11-30 17:10

    link your currentily folders to vscode.

    Windows Registry Editor Version 5.00
    
    ; Directory\Background\shell => on empty space
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]
    "Icon"="C:\\current-folder-vscode\\Code.exe,0"
    @="VsCode"
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
    @="C:\\current-folder-vscode\\Code.exe ."
    
    ; Directory\shell => on a folder
    
    [HKEY_CLASSES_ROOT\Directory\shell\vscode]
    @="VsCode"
    "Icon"="C:\\current-folder-vscode\\Code.exe,0"
    
    [HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
    @="C:\\current-folder-vscode\\Code.exe ."
    
    0 讨论(0)
  • 2020-11-30 17:11

    ⚡️ The Easy Solution.

    1. Download, install and open Visual Studio Code.
    2. Open the Command Palette ( + + P on Mac) OR ViewCommand Palette

    0 讨论(0)
  • 2020-11-30 17:12

    After opening VSC and pressing (Command + Up + P) I tried typing in "shell command" and nothing came up. In order to get "Shell Command: Install 'code' command in PATH command" to come up, you must do the following:

    1. Press (Command, Up, P)

    2. Type > (this will show and run commands)

    3. Then type Shell Command: Install 'code' command in PATH command. It should then come up.

      Once you click it, it will update and you should be good to go!

    MacOS X Launch from Command Line docs

    0 讨论(0)
提交回复
热议问题