[visual-studio] Open the terminal in visual studio?

How to open terminal for executing shell commands in Visual Studio(Community Version)?

This question is related to visual-studio

The answer is


For Microsoft Visual Studio Community 2017 use Ctrl+Alt+A

Alternatively from command panel view -> Other Windows -> Command Window

Command Window menu


Right click on your solution and above properties is the option open Command Line which gives access to default cmd, powershell and developer command prompt alternatively you can use the shortcuts Alt+Space for Default (cmd), Shift+Alt+, for Dev (cmd), Shift+Alt+. for powershell


In Visual Studio 2019, You can open Command/PowerShell window from Tools > Command Line >

enter image description here

If you want an integrated terminal, try
BuiltinCmd: https://marketplace.visualstudio.com/items?itemName=lkytal.BuiltinCmd

enter image description here

You can also try WhackWhackTerminal (does not support VS 2019 by this date).
https://marketplace.visualstudio.com/items?itemName=dos-cafe.WhackWhackTerminal


In Visual Studio 2019- Tools > Command Line > Developer Command Prompt.enter image description here


Microsoft just included an integrated Windows Terminal in Visual Studio version 16.3 Preview 3. Go to Tools > Options > Preview Features, enable the Experimental VS Terminal option and restart Visual Studio.

https://devblogs.microsoft.com/visualstudio/say-hello-to-the-new-visual-studio-terminal/


Visual Studio 2019 update:

Now vs has built-in terminal

TerminalSS

View > Terminal (Ctrl+")

To change default terminal

Tools > Options - Terminal > Set As Default

enter image description here


Before Visual Studio 2019

From comments best answer is from @Hans Passant

  1. Add an external tool.

Tools > External Tools > Add

Title: Terminal (or name it yourself)

Command=cmd.exe Or Command=powershell.exe

Arguments= /k

Initial Directory=$(ProjectDir)

  1. Tools > Terminal (or whatever you put in title)

  2. Enjoy!


View -> debug console (Ctrl+Shift+Y) next to debug console is terminal


To open the terminal:

  • Use the Ctrl` keyboard shortcut with the backtick character. This command works for both Linux and macOS.
  • Use the View > Terminal menu command.
  • From the Command Palette (??P), use the View: Toggle Integrated Terminal command.

Please find more about integrated terminal here https://code.visualstudio.com/docs/editor/integrated-terminal


New in the most recent version of Visual Studio, there is View --> Terminal, which will open a PowerShell instance as a VS dockable window, rather than a floating PowerShell or cmd instance from the Developer Command Prompt.

View then Terminal


As tricky solution you can use Package Manager Console to execute cmd or PowerShell commends

Shortcut for Package Manager Console Alt T N O

Tested on Visual Studio 2017 Community Version

enter image description here

Also its available now as part of Visual Studio version 16.3 Preview 3

Shortcut Ctrl+` same as Visual Studio Code


Not sure if this will help, but I usually pull the command prompt up by going into "Synchronization" tab in Team Explorer and clicking on "Actions"

When the command prompt opens it is in the directory of the project.