vscode|June 25, 2020|1 min read

VS-Code - How to put vscode executable in system path and how to open source code directly in vscode

TL;DR

Use VS Code's Command Palette to install the 'code' command in PATH, or manually add the VS Code executable to your system environment variables.

VS-Code - How to put vscode executable in system path and how to open source code directly in vscode

Introduction

VS code is an excellent free IDE for maany types of programming languaages. Lets take a look aat how we can add its executable path in our system path so that we can open it from our terminal or command line.

From VS Code itself

  • Open VS Code
  • Press Command + Shift + P

OR From View menu, click on Command Palette

Type:

>Shell command: Install

You will see one option like below:

VSCode Executable path

Thats it. It was so simple. No need to run any command to update your PATH variable.

Open Source code in VS Code from terminal

Now that vs code executable is added in your system path. You just need to open your terminal.

Example: Your source code is at folder:

/Users/test/github/myproject

Simply run (from anywhere)

code /Users/test/github/myproject

Or you can goto that code folder by cd command. And run:

code .

VS code is so light weight that you can use it as notepad. i.e. open any kind of text file in this IDE.

Related Posts

VS-Code - How to Debug and pass Command Line Arguments via Launch Config

VS-Code - How to Debug and pass Command Line Arguments via Launch Config

Introduction In this post, I will take example for Python project. And how we…

Microsoft Visual Studio Code - Must-have extensions for Developers

Microsoft Visual Studio Code - Must-have extensions for Developers

Visual Studio Code is one of the awesome developer tools by Microsoft. Let’s…

How to solve java issue - could not load main class - Visual Studio Code

How to solve java issue - could not load main class - Visual Studio Code

Assuming you have a java project and is using Visual Studio Code as IDE. All of…

Visual Studio Code - How to associate file extension to a known programming language

Visual Studio Code - How to associate file extension to a known programming language

Problem Statement I have a drupal module, where there is a file of extension…

Claude Code Skills — Build a Better Engineering Workflow with AI-Powered Code Reviews, Security Scans, and More

Claude Code Skills — Build a Better Engineering Workflow with AI-Powered Code Reviews, Security Scans, and More

Most developers use Claude Code like a search engine — ask a question, get an…

Building an AI Voicebot for Visitor Check-In — A Practical Guide to Handling the Messy Parts

Building an AI Voicebot for Visitor Check-In — A Practical Guide to Handling the Messy Parts

Every office lobby has the same problem: a visitor walks in, nobody’s at the…

Latest Posts

Claude Code Skills — Build a Better Engineering Workflow with AI-Powered Code Reviews, Security Scans, and More

Claude Code Skills — Build a Better Engineering Workflow with AI-Powered Code Reviews, Security Scans, and More

Most developers use Claude Code like a search engine — ask a question, get an…

Building an AI Voicebot for Visitor Check-In — A Practical Guide to Handling the Messy Parts

Building an AI Voicebot for Visitor Check-In — A Practical Guide to Handling the Messy Parts

Every office lobby has the same problem: a visitor walks in, nobody’s at the…

Server Security Best Practices — Complete Hardening Guide for Production Systems

Server Security Best Practices — Complete Hardening Guide for Production Systems

Every breach post-mortem tells the same story: an unpatched service, a…

Staff Engineer Study Plan for MAANG Interviews — The Complete 12-Week Roadmap

Staff Engineer Study Plan for MAANG Interviews — The Complete 12-Week Roadmap

If you’re a Senior Engineer (L5) preparing for Staff (L6+) roles at MAANG…

XSS and CSRF Explained — The Complete Guide with Real Attack Examples and Defenses

XSS and CSRF Explained — The Complete Guide with Real Attack Examples and Defenses

XSS and CSRF have been in the OWASP Top 10 for over a decade. They’re among the…

OWASP Top 10 (2021) — Every Vulnerability Explained with Code

OWASP Top 10 (2021) — Every Vulnerability Explained with Code

The OWASP Top 10 is the industry standard for web application security risks. If…