1.打开 VS Code 2.打开控制面板(快捷键 ⇧⌘P),输入 ‘shell command’ 3.在提示里看到 Shell Command: Install ‘code’ command in PATH,回车运行即可。