環境
- Mac 10.13.6
- zsh
起きた問題
VSCodeのshell command installは出来るのになぜかターミナルから使用できなかった
解決方法
.zshrc
をviで開く
$ vi ~/.zshrc
以下を追記する
function code {
if [[ $# = 0 ]]
then
open -a "Visual Studio Code"
else
local argPath="$1"
[[ $1 = /* ]] && argPath="$1" || argPath="$PWD/${1#./}"
open -a "Visual Studio Code" "$argPath"
fi
}
追記したら、以下を実行
$ source ~/.zshrc
以上でcode
コマンドでVisual Studio Codeをコマンドラインから起動出来るようになります。