“code .” Not working in Command Line for Visual Studio Code on OSX/Mac

前端 未结 25 2352
日久生厌
日久生厌 2020-12-12 09:13

The command \"code .\" doesn\'t work in this manual?

All the other steps before that worked. How can I call the Visual Studio Code in OSX terminal?

         


        
25条回答
  •  离开以前
    2020-12-12 09:42

    EDIT: If this is happening on mint/ubuntu, it is likely because you installed vscode through the software manager. This will cause other problems during debugging. Instead install it using the .deb file on the vscode website.

    If you really want to use the software manager, the solution below still works:

    use find / -name code 2> /dev/null to find the path to the visual studio bin file. It should end in /extra/vscode/bin/code

    If you're using the mint software manager, you might only find paths with a ridiculously long name in the middle like this:

    ".../stable/7a22830d9e8fbbdc9627e43e072005eef66c14d2a4dd19992427ef4de060186a/..."

    Just replace the long part with "/active/"

    Once you have it, create a sym link:

    ln -s path_you_found/extra/vscode/bin/code /usr/local/bin/code

    If you don't have the rights, or only want it to be accessible for yourself, simply add this line to your .bashrc / .zshrc:

    export PATH="$PATH:path_you_found/extra/vscode/bin/

    Note that I removed the 'code' filename at the end

提交回复
热议问题