Open the terminal in visual studio?

2020-02-20 07:37发布

问题:

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

回答1:

You can have a integrated terminal inside Visual Studio using one of these extensions:

Whack Whack Terminal

Terminal: cmd or powershell

Shortcut: Ctrl\, Ctrl\

Supports: Visual Studio 2017

https://marketplace.visualstudio.com/items?itemName=DanielGriffen.WhackWhackTerminal


BuiltinCmd

Terminal: cmd or powershell

Shortcut: CtrlShiftT

Supports: Visual Studio 2013, 2015, 2017, 2019

https://marketplace.visualstudio.com/items?itemName=lkytal.BuiltinCmd



回答2:

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)

2) Tools > Terminal (or whatever u put in title)

3) Enjoy!



回答3:

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



回答4:

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/



回答5:

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.

-L-



回答6:

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



回答7:

View -> debug console (ctrl + shift + Y) next to debug console is terminal



回答8:

For Microsoft visual studio community 2017 use CTR+ALT+A

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