Featured image of post How to Open a File or Folder in VSCode from the Terminal

How to Open a File or Folder in VSCode from the Terminal

How to Open a File or Folder in VSCode from the Terminal

Install shortcut command for vscode

First, let’s do the shortcut CMD + SHIFT + P (or CTRL + SHIFT + P for Windows) and type code path which should make appear the following result:

Select the first option and your computer should prompt you with some administrator privileges — which is fine!

VSCode Terminal Open

Now, open a new terminal to have the new path and type the command code -h

You should see the command working:

VSCode Terminal Open

Open file or folder from the terminal

# Open current folder
code .
# Open specific file
code some-specific-file.js

Reference

All rights reserved,未經允許不得隨意轉載
Built with Hugo
Theme Stack designed by Jimmy