Press continue icon in the debug tool bar to finish debugging and get the result in the terminal console. We have covered setting up a python workspace in Visual Studio Code on macOS along with basic debugging configurations. Installing Python packages and using them in VS Code.
Uninstall Visual Studio for Mac The first step in uninstalling Visual Studio from a Mac is to locate Visual Studio.app in the /Applications directory and drag it to the Trash Can. Alternatively, right-click and select Move to Trash as illustrated in the following image. Drag Visual Studio Code.app to the Applications folder, making it available in the macOS Launchpad. Add VS Code to your Dock by right-clicking on the icon to bring up the context menu and choosing Options, Keep in Dock. Launching from the command line # You can also run VS Code from the terminal by typing 'code' after adding it to the path.
Question or issue on macOS:
Visual Studio For Mac Clear Terminal
I’d like to run / open Visual Studio Code from the Mac OSX Terminal by running this command code .. I found instructions here:
https://code.visualstudio.com/Docs/setup
Apparently I need to include this in my .bashrc file, so I did, but to no avail.
I edited the .bashrc file here:
~/.bashrc which points to /Users/username/.bashrc
Which .bashrc should I be editing?
How to solve this problem?
Solution no. 1:
Try this one
Open Visual Studio Code and press Command + Shift + P or F1 then type Shell
in command palette now you are able to find this option like Shell Command : Install code in PATH
from suggested list in command palette. Select that options.
That’s it.
Now open your terminal type.
Solution no. 2:
I just want to pull out Benjamin Pasero’s answer from inside his comment as it seems the best solution. It is the tip given on the Setting up Visual Studio Code page where it says …
If you want to run VS Code from the terminal, append the following to your ~/.bash_profile file (~/.zshrc in case you use zsh).
Now, you can simply type code .
in any folder to start editing files in that folder. [Or code test.txt
to go to work on the test.txt
file]
Solution no. 3:
If you are on Mac OSX Maverick,
it’s ~/.bash_profile
not ~/.bashrc
Try putting the code in there, close the terminal and then try again. Should be working
Solution no. 4:
For Mac you can do :
View > Command Palette > Shell command > “install code command in path”. I’d assume there would be something similar for other OS’s. After I do
and it tells me it put it in /usr/local/bin
Solution no. 5:
Sometimes, just adding the shell command doesn’t work. We need to check whether visual studio code is available in “Applications” folder or not. That was the case for me.
The moment you download VS code, it stays in “Downloads” folder and terminal doesn’t pick up from there. So, I manually moved my VS code to “Applications” folder to access from Terminal.
Step 1: Download VS code, which will give a zipped folder.
Visual Studio For Mac Terminal Free
Step 2: Run it, which will give a exe kinda file in downloads folder.
Step 3: Move it to “Applications” folder manually.
Step 4: Open VS code, “Command+Shift+P” and run the shell command.
Step 5: Restart the terminal.
Step 6: Typing “Code .” on terminal should work now.
Solution no. 6:
For Mac users:
One thing that made the accepted answer not work for me is that I didn’t drag the vs code package into the applications folder
So you need to drag it to the applications folder then you run the command inside vs code (shown below) as per the official document
- Launch VS Code.
- Open the Command Palette (⇧⌘P) and type ‘shell command’ to find the
Shell Command: Install ‘code’ command in PATH command.
Solution no. 7:
To set up VS code path permanently on Mac OS;
just open .bash_profile using the following command on terminal
Then add the following path to .bash_profile
save the .bash_profile file and quit the terminal. Then reopen the terminal and type code .
to open VS code.
Solution no. 8:
How about a simple Bash alias that you stick in your .bash_profile ?
alias code=”open -a /Applications/Visual Studio Code.app”
To open the current directory:
Visual Studio For Mac License
code .
Solution no. 9:
To set it up, launch VS Code. Then open the Command Palette (⇧⌘P) and type shell command to find the Shell Command: Install ‘code’ command in PATH command.enter image description here
Solution no. 10:
I simply created a file called code:
Make it executable:
Then put that in /usr/local/bin
As long as the file sits someplace that is in your path you can open a file by just typing: code