The question says it all.
How can I call VS Code editor from
- windows cmd
- linux and mac terminal
e.g. for notepad++ I write
> start notepad++ test.txt
By the way, the editor is awesome (cross-platform)! Thank you Nadella!
You can download it from microsoft
VS Code is a must have code editor for 2018
For Windows 10 users a lot is possible, the same way the Mac OS users type
code .
.Look for you VS Code \bin folder path e.g
C:\Program Files\Microsoft VS Code\bin
. The bin folder includes a file calledcode.cmd
Follow the steps below and be proud of the OS you use.
Search for "Advanced System Setting" from Start.
Click on Environment Variables
On System Variables choose "path" from Variable tab and click on Edit.
Click on New on the right side of the popup window.
Copy your path from the Explorer's breadcrumb path and paste it into the new opened path in step 4, example:-
C:\Program Files\Microsoft VS Code\bin
Click Ok on all the open windows to confirm changes and restart your
cmd
Go to your
cmd
and navigate to you working directory on server and typecode .
C:>cd wamp64\www\react-app> code .
to open with VS Code on Windows.Visual Studio Code also includes a command prompt (terminal) window and you can open one or more of them with
Ctrl + `
on your keyboard.Hope this helps some one like it did to many of us.
This works for Windows:
But if the filepath has spaces, normally one would add double quotes around it, like this:
But this messes up with start, which can take a double-quoted title, so it will create a window with this name as the title and not open the project.
typing "code" in dos command prompt worked for me
Per the docs:
For command line heads you can also run
sudo ln -s "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" /usr/local/bin/code
this will do the exact same thing as the
Shell Command: Install 'code' command in PATH command
feature in VSCode.In the case of Linux and Mac, you want to navigate to the directory that you extracted the VSCode files using the 'cd' command. For example:
Then you start the application by running..
'Code' being the name of the executable.
If you have root access on the machine, you can configure the system to allow you to start VSCode from anywhere by linking it to /usr/bin, where links to executables are often stored.
You can now launch VSCode from anywhere by typing: