Command to open another instance of integrated terminal on Visual Studio Code? - bash

This question is specifically for Visual Studio Code (VS Code) and it's integrated terminal.
Is it possible to open another integrated terminal to run certain commands from npm scripts or from within one terminal?
For example: if the command "Start cmd" is executed, it opens a new separate window. But, is it possible to force that command to open and run inside another integrated terminal within VS Code?
Note:
There are keyboard shortcuts avaiable to open, close, show, hide etc, but this question is asking about performing these actions from code or command not using keyboard shortcut.

Visual Studio code has nice keyboard shortcuts for opening new integrated terminal instances:
For Windows:
Ctrl+Shift+`
For Macintosh
Ctrl+Shift+~
For more information on shortcuts take a look here for Windows and here for Macintosh. At least this way you can run any command you want in multiple instances. For example, run your server in one integrated window, and other one off commands in another instance, etc...
Hopefully that helps!

Related

Visual Studio Code: Text and cursor position are not correct

I'm experiencing a strange behavior from the integrated visual studio code console. The text is not well-formatted and the cursor is not well-positioned:
Software versions:
Windows 10 Pro;
Visual studio Code 1.55.2;
I already tried:
Close the visual studio code and open again;
closing all instances of integrated terminals and opened them again;
Use cmd instead of powershell.
After some tests, I finally found out the PowerShell was selected as the default terminal profile. After changing it to Command Prompt, the feel and look were back to normal.
Follow the steps to change the default terminal profile:
Open the select box on the top corner of the terminal;
Choose the options "Select Default Profile";
Then select Command Prompt.

How can my integraded terminal automatically cd into the directory of the currently active file?

I'm pretty new to Visual Studio Code and am used to a nice feature from my previous IDE. That feature had the integrated terminal follow the active file into its directory, at all times. So when I switched to viewing another file in my IDE, the integrated terminal would change its cwd to that new file's directory.
I'm aware of the Terminal Here Extension and the context menu option:
The problem with both is, that they require action on my part, i.e. using a shortcut or the context-menu respectively. I want the terminal to just change into the active file's directory, whenever I switch to another file.
How can I achieve this with Visual Studio Code?

How do I "open a new terminal" for the NODE and NPM tools to be on my PATH?

I am learning the basics of Visual Studio Code. I am reading the first node.js tutorial. Having successfully installed node.js already, I am stuck at the next sentence that says:
You'll need to open a new terminal (command prompt) for the node and npm command line tools to be on your PATH.
First open the project on Visual studio code then click on View link this will displayed on top left side on your visual code and select the Terminal it will open the power shell and this is on your same directory that you are using...
or if you are using a system terminal or power shell then click command+t it will open the multiple terminals
Click on the "View" menu and select "Integrated Terminal". That will open a powershell or terminal (based on what operating system you are on), that is located att the same folder as the project you have opened.

Greenshot does not work in Visual Studio

Anyone know why you cannot use Greenshot in Visual Studio? I hit the Screen Print button and it does not bring up the cross-hairs to drag my window size. Instead it just takes a plain windows screenshot. I looked for keyboard commands that might override it but didnt see anything at first glance. It works for every other program but not when Visual Studio is the active window.
It's because your visual studio is running in a higher level (permission wise) than your greenshot instance.
for a one time test, close Greenshot, and run it as administrator (right click on the file, run as administrator).
As a more permanent solution, you can just set the compatibility mode for the file to be run in admin mode, and then when it's started on start up it should capture your VS instances as well :).
Edit:
Just in case, you can easily figure out if anything else is wired to a shortcut by doing the following:

Using the command line from within Visual Studio

I'd like to have a tool window in Visual Studio that allows me to type command line things (e.g. git stash, npm install, etc.) in the current project's working directory. Something like this in Eclipse.
I can't find any such option in any of the menus, but admittedly they're labyrinthine. I tried looking through the Visual Studio gallery, but no dice either. Any extension or hidden option that would give me this?
PowerShell would probably also work, as from what I understand that's a superset of the regular shell.
In Visual Studio 11, the NuGet Package Manager Console is a fully featured PowerShell console. You can do all kinds of things there, including file system operations, git/hg/svn/tfs commands, etc.
You also can customize the experience with a special PowerShell profile called NuGet_profile.ps1.
Installing the NuGet VSIX from the Visual Studio gallery will get you a similar experience in VS2010 if I'm not mistaken.
For anyone that comes across this in 2018+, there is now also the Whack Whack Terminal extension from Microsoft's Daniel Griffen (#dgriffen on GitHub), which gives you exactly what you were looking for.
Whack Whack Terminal is a terminal emulator for Visual Studio 2017. Unlike other terminals for VS, Whack Whack Terminal is fully interactive. Users can launch interactive git commits, vim, or almost any other command line utility.
The default terminal is powershell and it can be opened with the shortcut chord "Ctrl+\, Ctrl+\".
CMD and WSLBash are also available terminal choices.
It's also open source! You can find the source code at Microsoft/WhackWhackTerminal on GitHub.
There is a command window in Visual Studio (CTRL + ALT + A) or (View -> OtherWindows -> Command Window)
You can then use the shell command to run external executables
The syntax is:
shell [/command] [/output] [/dir:folder] path [args]
You can download PowerConsole from the Visual Studio extensions gallery.

Resources