Visual Studio Terminal

  • To open Visual Studio Code from your command line, you need to make sure that you have the VS Code command line tools installed. On Windows, this should work out of the box. On Mac, open up VS Code, go to View - Command Palette and search for this: Shell Command: Install 'code' command in PATH. Just type “shell” and it should pop up.
  • In Visual Studio for Mac you can open an integrated terminal window, initially starting at the root of your solution.
Visual Studio Terminal

Write or select a set of commands in Text Editor, then use shortcut Ctrl+Alt+R, or press F1 and then select/type Run Terminal Command, the commands will run and the output will be shown in the Output Window. To stop the running commands, use shortcut Ctrl+Alt+C, or press F1 and then select/type Stop Terminal Command.

Update: Visual Studio Community 2019 – Git Integration
The git integration with Visual studio is great. It is able to find all the git repositories on your machine and show them all nicely in the team explorer.


However, when working with git, it is very useful to see the actual command line output. Using the GUI can obscure what is actually going on.
TFVC source control has the same problem, as when getting the latest changes, you don’t automatically see everything that’s happening, unless you take the time to open the Output window and navigate to the TFVC Output, where with the default settings you only see updated files in a list.

Terminal

The command line is what really lets you see the details of what’s happening, as well as giving you the ability to try out all the commands and options, not all of which are available from within visual studio.
Below we can see all the details associated with a git pull from a remote repository. Insertions, deletions, and associated counts are neatly laid out and colored in green and red.


How to Quickly Open the Command Prompt with the Project Directory
To quickly get started with the command prompt, it is very helpful to be able to open it directly in the path for the current project. To do this right click on the local git repository in VS and select open command prompt..

Visual Studio Terminal Code

This opens a cmd.exe window opened to the project directory. I don’t like having to use tools outside the IDE unless absolutely necessary, as the context switching can slow productivity. I have started using the extension below which integrates a terminal windows.
Better Integration with a marketplace Extension (vsix)

Update for Visual Studio Community 2019 – Seamless Git Integration

Visual Studio Terminal Closes Immediately

Starting with Version 16.6, git functionality is accessible from within Visual Studio without installing an additional extension.
A new Git menu appears in the window title bar. I had some difficulty getting this menu to appear in my environment, but I eventually got it to work by toggling the “New git user experience” in the Preview Features of settings. For most users, the Git menu should appear by default by installing the new version of Visual Studio.

How To Open Visual Studio Terminal