Git bash integrates well into VS Code but not Visual studio. In VS Code, it opens in the terminal tab but in Visual Studio (17.4.2), it opens as a separate window.
Is there a way I can get git bash to open as an integrated terminal, just like Developer Powershell?
I couldn't reproduce this problem. git-bash runs in the terminal tab as expected.
What I did:
From the menu choose Tools -> Options
In the Options dialog choose Environment -> Terminal
Add a new Profile with
Name: Git Bash
Shell Location: C:\Program Files\Git\bin\bash.exe
Arguments: -i -l
The terminal in Visual Studio is based on the Windows Terminal. I used the 'Git Bash' profile in Windows Terminal as the template for the profile in Visual Studio.
Related
Is there any way to open a file in Visual Studio 2022 in order to edit it using commands?
Specifically in the "Package Manager Console" or "Command Window" or ... inside Visual Studio?
Let me explain: I'm using the commands shown here to create a file in my project (in PMC):
cd <somewhere in project>
new-item <filename.extension>
Now I want to open this specific, newly create file in order to edit it. Not with a mouse and keyboard shortcuts - just with commands.
I know I can do it in Windows cmd with:
cd <file path>
<filename.extension> /edit
but what about a console in Visual Studio?
Thanks buddies
I use Bash terminal on Windows. And I confused how can I run the Visual Studio solution from terminal?
For example
open the terminal
git clone https://github.com/somerepository.git
cd somerepository
*VISUAL-STUDIO* somerepository.sln
Just only.
What can I write instead of VISUAL-STUDIO
UPD.
I use "Git For Windows", its provides a BASH emulation.
How can I open the terminal for executing shell commands in Visual Studio (Community Edition)?
Visual Studio 2022/2019
Now Visual Studio has a built-in terminal:
Menu View → Terminal (Ctrl + ")
To change the default terminal
Menu Tools → Options → Terminal → Set As Default
Before Visual Studio 2019
From comments, the best answer is from Hans Passant.
Add an external tool.
Menu Tools → External Tools → Add
Title: Terminal (or name it yourself)
Command = cmd.exe or Command = powershell.exe
Arguments = /k
Initial Directory = $(ProjectDir)
Menu Tools → Terminal (or whatever you put in title)
Enjoy!
You can have an integrated terminal inside Visual Studio using one of these extensions:
Whack Whack Terminal
Terminal: CMD or PowerShell
Shortcut: Ctrl + \, Ctrl + \
Supports: Visual Studio 2017
BuiltinCmd
Terminal: CMD or PowerShell
Shortcut: CtrlShiftT
Supports: Visual Studio 2013, 2015, 2017, and 2019
As a tricky solution, you can use Package Manager Console to execute CMD or PowerShell commands.
Shortcut for Package Manager Console: Alt + T, + N, O
Tested on Visual Studio 2017 Community version.
Also it's available now as part of Visual Studio version 16.3 Preview 3
The shortcut is Ctrl + `, the same as Visual Studio Code.
New in the most recent version of Visual Studio, there is menu View → Terminal, which will open a PowerShell instance as a Visual Studio dockable window, rather than a floating PowerShell or CMD instance from the Developer Command Prompt.
GOOD NEWS! Now, Visual studio has built-in terminal. In visual studio 2022 (and latest vs2019), We can open terminal from View>Terminal
In Visual Studio 2019, you can open Command/PowerShell window from menu Tools → Command Line:
If you want an integrated terminal, try
BuiltinCmd:
You can also try WhackWhackTerminal (does not support Visual Studio 2019 by this date).
Microsoft just included an integrated Windows Terminal in Visual Studio version 16.3 Preview 3. Go to menu Tools → Options → Preview Features, enable the Experimental VS Terminal option and restart Visual Studio.
Say hello to the new Visual Studio terminal!
In Visual Studio 2019, menu Tools → Command Line → Developer Command Prompt.
I am 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.
Right click on your solution and above "Properties" is the option "Open Command Line" which gives access to the default CMD, PowerShell and developer command prompts.
Alternatively, you can use the shortcuts Alt + Space for the default (CMD), Shift + Alt + , for Developer (cmd), Shift + Alt + . for PowerShell.
To open the terminal:
Use the Ctrl + ` keyboard shortcut with the backtick character. This command works for both Linux and macOS.
Use the menu View → Terminal menu command.
From the Command Palette (Shift + ⌘ + P), use the View: Toggle Integrated Terminal command.
Please find more about the integrated terminal in Integrated Terminal.
In case you don't see view->terminal, please - check your installed plugins. In my case Terminal disappeared after i installed "vsSolutionBuildEvent" plugin. I don't know why and how it is related, but "Terminal" appeared again only i uninstalled it. CTRL+~ is also start working. MVS 2022 Community Edition.
Hope, will help someone.
Menu View → Debug console (Ctrl + Shift + Y). Next to the debug console is the terminal.
For Microsoft Visual Studio Community 2017 use Ctrl+Alt+A
Alternatively from command panel view -> Other Windows -> Command Window
I need to run web.exe file from my developer command prompt in Visual Studio 2013. By default, the command prompt is not installed in Visual Studio 2013.
Previously, I was using Visual Studio 2012. It had developer command prompt installed by default.
Does anyone know why VS2013 doesn't have developer command prompt by default? How can I setup developer command prompt for VS2013?
For some reason, it doesn't properly add an icon when running Windows 8+. Here's how I solved it:
Using Windows Explorer, navigate to:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2013
In that folder, you'll see a shortcut named Visual Studio Tools that maps to (assuming default installation):
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts
Double-click the shortcut (or go to the folder above).
From that folder, copy the shortcut named Developer Command Prompt for VS2013 (and any others you find useful) to the first directory (for the Start Menu). You'll likely be prompted for administrative access (do so).
Once you've done that, you'll now have an icon available for the 2013 command prompt.
From VS2013 Menu Select "Tools", then Select "External Tools". Enter as below:
Title: "VS2013 Native Tools-Command Prompt" would be good
Command: C:\Windows\System32\cmd.exe
Arguments: /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"
Initial Directory: Select as suits your needs.
Click OK.
Now you have command prompt access under the Tools Menu.
I used a modified version of this answer - based on my experiences adding it to VS 2010:
Select Tools >> External Tools in Visual Studio
Click Add
Title: I use Visual Studio Command &Prompt
&P Makes P a alt-shortcut key (when menu active)
I originally used C, but that conflicts with the existing shortcut for Customize
Command: C:\Windows\System32\cmd.exe
Arguments: \k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\vsvars32.bat
/k keeps a secondary session active so the window doesn’t close on the .bat file
Initial Directory: I use $(ProjectDir) (from the dropdown)
Click OK.
Now you have command prompt access under the Tools Menu.
See also: Add command prompt to Visual C# Express 2010
You can simply go to Menu > All Programs > Visual Studio 2013. Select the folder link "Visual Studio Tools". This will open the folder. There is bunch of shortcuts for command prompt which you can use. They worked perfectly for me.
I think the trick here might be there are different versions for different processors, hence they put them all together.
I don't know if this changed recently -- the answer given by Samuel did not apply to me even though that link seemed authoritative.
A couple of things
1) For some reason, the folder in the start menu is called Visual Studio 2013, and not Microsoft Visual Studio 2013. Using the win8 apps interface you might see the 2010 entry Microsoft Visual Studio 2010, and since you don't see the new 2013 folder Microsoft Visual Studio 2013 next to it, you assume it isn't there. But it is.. Just a few page scrolls away..
2) It seems the Windows 8 (or 8.1 at least) cannot display sub-folders. I tried creating a folder underneath the Visual Studio 2013 folder with shortcuts, and the entire folder just didn't show.
3) Which is why what is installed is a shortcut. Not sure what the windows 7 behavior is with a shortcut in the start menu, but the apps menu just displays it like a folder. When you click on it, it brings you to the so-called missing shortcuts in explorer.
Final solution: under C:\ProgramData\Microsoft\Windows\Start Menu\Programs, create a new folder called Microsoft Visual Studio 2013. Copy the shortcuts from C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts to that new folder. Then you'll have your icons using the windows 8 app interface under the heading which is the new folder name.
You'll also be able to just start typing from the start screen VS2013, and the icons will now show up.
Since any solution given so far will open the command prompt on the project folder, you would still have to navigate to the project's folder. If you are interested in getting the command prompt directly into the project's folder, here is my 2 steps:
Right-click in solution explorer on the project name (just under
the solution name) and choose the command "Open Folder in File
Explorer"
Once the Windows Explorer is open, just type in the
address bar "cmd" and then hit enter!
Et voila! Hope that helps
Visual studio command prompt is nothing but the regular command prompt where few environment variables are set by default. This variables are set in the batch script : C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat . So basically to get a visual studio command prompt for a particular version, just open regular command prompt and run this batch script : C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat (Change the visual studio version based on your installed version). Voila you have got the visual studio command prompt. You can write a script to run the batch file and open cmd.exe.
Works with VS 2017
I did installed Visual Studio Command Prompt (devCmd) extension tool.
You can download it here: https://marketplace.visualstudio.com/items?itemName=ShemeerNS.VisualStudioCommandPromptdevCmd#review-details
Double click on the file, make sure IDE is closed during installation. Open visual studio and Run Developer Command Prompt from VS2017
I'm using VS 2012, so I navigated to "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Visual Studio 2012\Visual Studio Tools" and ran as administrator this "Developer Command Prompt for VS2012" shortcut. In command shell I pasted the suggested
aspnet_regiis -i
and as I suspected this did not yield any success on Windows 10:
So all I needed to do was "Turn Windows Features On/Off" at Control Panel and restart my machine to effect the changes. That did resolve the issue. Thanks.
I would like to be able to embed a command line interpreter inside a dockable window in Visual Studio. Is there any nice way to do this?
See the VS Command shell project
Checkout Open Command Line by Mads Kristensen. note it doesn't really "embed" the shell in VS, rather it adds a keyboard shortcut to open the shell at the project directory
it supports bash, powershell, git bash, ...etc
In Visual Studio click Tools -> NuGet Package Manager -> Package Manager Console
It embeds a cmd prompt with everything on your %PATH% you'd expect.