Visual Studio toggle terminal with one shortcut - visual-studio

Only Visual Studio, not code. This is the 2022 Community Edition, but can also use 2019. I want to use one shortcut that will both open and close the terminal. Searched but no answers. I find a setting to open the terminal with a shortcut but none to close it as well. Anyone know if this is possible?

you can try "control shift `" if you are on window

Press from the keyboard and toggle your vs code terminal
(control+Backtick)
ctr+`
note: I am using mac

Pressing SHIFT + Esc will close the terminal window if it has focus. There is no global 'close terminal' in Visual Studio.
An alternative to using the terminal in Visual Studio could be to use the 'quake mode' in Windows Terminal (assuming you are on Windows) by pressing the WIN + ` to quickly open/close a terminal at the top of your screen.

Related

How to scroll up through integrated terminal with keyboard on visual studio?

I am using Visual studio 2022 and 2019 on windows 10. Is there a way to scroll up and down using the keyboard on the integrated terminal screen opened from the view>terminal tab in visual studio?
I tried all of the following shortcuts CTRL+Page Up/Down and CTRL+Shift+Page Up/Down and CTRL+Up Arrow/Down but doesnt work. I want to scroll up/down in terminal using keyboard without using mouse scroll.
in Keyboard shortcuts
search for (Terminal scroll Up(Line)) & (Terminal scroll Down (Line))
edit this shortcut of your choice and this will work.

What is the shortcut to open the Visual Studio Code integrated terminal on macbook?

I have been searching for the shortcut to open visual studio code Integrated Terminal on my macbook. In the menu it say ^` (shift 6 backtick) but this is not working on my mac. I am not sure how to make a new shortcut to open the integrated terminal.
^ denotes the control key. So it's ctrl-backtick.

Visual Studio Keyboard Shortcut of quick watch (shift + F9) Not Working

My quick watch (shift + F9) shortcut suddenly is not working.
But its alternate keyboard chord Control + Alt + Q works fine.
And all other shortcut seems working fine. But quick watch is the only one that I currently found.
I have tried other shortcut with Shift or with F9 , no problem.
I am also using Resharper, is that affecting VS Shift F9?
If you have Snag-It installed on your machine, its global shortcuts may override application specific shortcuts in Visual Studio (or other apps).
See #nuri's answer here: Visual Studio 2010 QuickWatch window not visible for instructions and screen-shots to change the Snag-It settings.
In the meantime, just go into the Snag-It preferences, the HotKeys tab, and set the "Video capture start/pause/resume" hot key to something other than [Shift]-[F9]. For myself, I only use "Global capture", so I set everything else to "None".
You can try the following:
In TOOLS --> Options | Keyboard, make sure the right mapping scheme is selected (Visual C# 2005 for me) and click Reset and finally, Ok

Visual Studio: Shortcut to close window not working

I changed the shortcut to close a window to Ctrl+W and to close all windows to Ctrl+Shift+W. Close all windows works fine, but Ctrl+W selects the word currently under the cursor but does not close the window.
When I right-click a tab it say Ctrl+W is the shortcut to close it (And also Ctrl+S to save and Ctrl+Shift+W to close all). Why is only the close window shortcut not working?
In Visual Studio (VS 2015 in my case but it's similar down to VS 2010 at least) keyboard shortcuts may have a different meaning depending on the context in which they are executed.
Click Tools / Options / Environment / Keyboard to look up or define shortcuts (you already did that probably). What I called "context" is selected in the combobox labelled "Use new shortcut in:". Most likely you defined the shortcut in "Global" but you want it to work in "Text Editor". In the latter Ctrl+W selects the current word.
Redefine Ctrl+W for "Text Editor" and you should be fine.
I am using Visual Studio 2017 & Visual Studio 2019 and tried the answer from #TobiMcNamobi but it didn't work for me. After few such tries I got it work with below steps.
You should add it as Global shourtcut otherwise it will not work for Designer views.
Add CTRL+W as a Global shortcut for Window.CloseDocumentWindow
Remove the CTRL+W shortcut for Edit.SelectCurrentWord
In Visual Studio 2019 it is Ctrl-F4 by default to CloseDocumentWindow. The action is Window.CloseDocumentWindow. I know this is old but the accepted answer has you change the short-cut key instead. I would rather use the default option.
Tools -> Options -> Environment -> Keyboard
If you're ever unsure go to the path above and you will see the image above then you can click inside the box "Press shortcut key" at the bottom of the form and type the short cut key you're interested in and it will tell you if it is used and what it is currently used for.
You can also reference the docs
https://learn.microsoft.com/en-us/visualstudio/ide/default-keyboard-shortcuts-in-visual-studio?view=vs-2019
2021: For Visual Studio 2019:
See: https://gist.github.com/jpoehls/2030795#gistcomment-2335647
In my case, I had to existing assignments that I had to remove. Thereafter, I could use the hotkey.
In my case, the tabs were not closing because I am using Vim extension. I had to add the following lines to Vim settings:
"vim.handleKeys": {
"<C-w>": false
}
Just press Ctrl + , or Command + , for Mac users, search for Vim and go into Edit in settings.json as the following picture shows:
Screenshot
For Visual Studio 2022, make sure you also remove Ctrl+W from selectCurrentWord command.
In my VS Pro 2019, on Tools / Options / Environment / Keyboard, the first line offers using a premade keyboard mapping scheme, with a drop-down option for VSCode keyborad mapping theme.
I picked it and it seems to have adopted the keyboard shortcuts I was used to from working on VSCode, Ctrl+W included.
For those using linux with VSCode v1.56.2,
File --> Preferences --> Keyboard Shortcuts.
Search for View:Close Editor and as mentioned above, remove any keybinding that has the keybinding you want.

Curly braces in visual studio running desktop parallels mac

I'm testing visual studio in desktop parallels win7 running on my Macbook air. Everything works fine except that i cannot get curly braces to work inside visual studio.
The Curly braces do work Shift + right-alt 7/8 (tested in notepad) but something is overriding the key combination inside visual studio.
software specs in parallels
Windows 7
Visual studio 2012
Resharper
I think it is Resharper that is messing with me. Does anyone know how to turn off a shortcut, specifically the key combination shift + right-alt + 7/8 so i can get curly braces working again.
You can check all the different shortcuts in Visual Studio and modify them as you like.
In Visual Studio goto: Tools -> Customize and press the Keyboard button at the bottom.
Then, in the "Press Shortcut Key" TextBox just press the key combination and you'll see what command it is set to, and you can remove/redefine that combination
I had the same problem, but I finally found how it work:
for { type right-alt+5 and for [ type right-alt+shift+5
In Visual Studio 2015 the keyboard settings are at Tools -> Options under Environment/Keyboard.
I could not find the bound command by pressing the shortcut.
After some digging i discovered the command name: ReSharper_EnableDaemon. Removing all shortcuts for this command, I can now type { again.
Try to use fn + alt (right alt key) + 7/8 in your keyboard. Should fix most of those Mac parallel issues.

Resources