摘要
在Terminal中使用VScode中自帶的code函數時,出現錯誤如下:
| 1 | command not found code | 

除錯
- 確保已將Visual Studio Code應用程式放到Applications文件夾中,否則 VS code 重新啟動後,您將不得不再次執行此過程
- 接下來打開Visual Studio Code,透過(⇧⌘P)打開面板然後輸入以找到Shell命令:shell command
選擇 Install ‘code’ command in PATH

最後重啟Terminal或執行(~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc):
| 1 | $ source ~/.zshrc |