KennyEdward
KennyEdward

Reputation: 25

How can I run the command: "code ." from MacOS terminal after VS Code installation

I keep getting this error when I run: code . on MacOS terminal

-bash: code: command not found

-bash: code: command not found image

Upvotes: 1

Views: 308

Answers (1)

KennyEdward
KennyEdward

Reputation: 25

Reading through the launching-from-the-command-line section of VS Code official documentation answers this question.

Steps

  1. Launch VS Code
  2. Open the Command Palette (F1) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.
  3. Restart the terminal for the new $PATH value to take effect. You'll be able to type 'code .' in any folder to start editing files in that folder.

Upvotes: 1

Related Questions