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

前端 未结 25 2397
日久生厌
日久生厌 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条回答
  •  猫巷女王i
    2020-12-12 09:42

    https://code.visualstudio.com/Docs/setup

    Tip: If you want to run VSCode from the terminal, append the following to your .bashrc file

    code () {
    if [[ $# = 0 ]]
    then
        open -a "Visual Studio Code"
    else
        [[ $1 = /* ]] && F="$1" || F="$PWD/${1#./}"
        open -a "Visual Studio Code" --args "$F"
    fi
    }
    

    Then $ source ~/.bashrc

提交回复
热议问题