“代码".无法在 OSX/Mac 上的 Visual Studio Code 命令行中工作 [英] "code ." Not working in Command Line for Visual Studio Code on OSX/Mac
问题描述
code .
命令在
执行命令后,重启终端获取新的$PATH值生效.您只需输入代码"即可.在任何文件夹开始编辑该文件夹中的文件.."简单的意思是当前目录"
(来源:VS Code 文档)
注意:如果您运行的是基于 OSS 存储库的构建...您将需要运行 code-oss .
@Dzeimsas Zvirblis
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?
Monas-MacBook-Pro:myExpressApp mona$ pwd
/Users/mona/nodejs/myExpressApp
Monas-MacBook-Pro:myExpressApp mona$ code .
-bash: code: command not found
EDIT: I ended up opening it from within Visual Code Studio by changing the workspace but I am wondering why that command code .
won't work?
1. Make sure you drag Visual Studio Code app into the -Applications- folder
Otherwise (as noted in the comments) you'll have to go through this process again after reboot
2. Next, open Visual Studio Code
Open the Command Palette via (⇧⌘P) and type shell command
to find the Shell Command:
Update: use Uninstall 'code' command in PATH** command before
> Install 'code' command in PATH** command.
After executing the command, restart the terminal for the new $PATH value to take effect. You'll be able to simply type 'code .' in any folder to start editing files in that folder. The "." Simply means "current directory"
(Source: VS Code documentation)
NOTE: If you're running a build based off the OSS repository... You will need to run code-oss .
@Dzeimsas Zvirblis
这篇关于“代码".无法在 OSX/Mac 上的 Visual Studio Code 命令行中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!