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

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.

Related

Prevent Visual Studio Code from opening up when Open in Terminal option is selected

When I right click on a folder in the path bar and select the Open in Terminal option a VS Code window pops up instead of the classical terminal window. If I delete VS Code then the action is performed correctly and the terminal opens up. How do I disable this extremely annoying feature of VS Code?
My mac runs Ventura 13.1 and VS Code version is 1.74.3

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.

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

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!

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 to open two / multiple instances of Visual Studio for MAC?

I wish to open multiple instances of VS for Mac. I used to be able to do this with Xamarin studio using the Xamarin launcher.
How to do this with VS for Mac?
Open a terminal window, and then issue the following command:
open -n -a "Visual Studio"
Alright, at last!, Microsoft has just implemented the simplest solution of all in Visual Studio 2019: just right click on its icon on the launch bottom bar, and choose "New instance":
See the details of the feature in the release notes of VS2019 for Mac Preview.
There is also the option of opening multiple solutions in the same Visual Studio instance.
From Recent list: Hold Ctrl while clicking the solution name
From File -> Open: Single click the .sln file, click Options and uncheck Close Current Workspace.
Credit: https://www.jimbobbennett.io/opening-multiple-solutions-in-visual-studio-for-mac/
Note. the active project(For run/debug) changes depending on which file you have marked/selected/editing.
If you don't want to daily search for this specific terminal command, create a script as below:
Open "Script Editor" in Mac
Paste: do shell script "open -n -a 'Visual Studio'"
Save this file somewhere (On Desktop)
Whenever need to launch another instance, simply open this file and
click on "Run the Script" button
Screenshot Here
Visual Studio Code
Version: 1.39.2
Official documentation: How do I open multiple solutions or instances of Visual Studio for Mac?
Open a second solution inside a single instance
To open a second solution alongside your first solution, use the following steps:
With your first solution already open, select File > Open.
Select the solution and press the Options button.
Uncheck the Close Current Workspace button:
Press the Open button to open the second solution in the Solution Pad.
Alternatively, if you have recently opened the solution, you can do the following:
Go to the File > Recent Solutions menu item:
Hold down the Ctrl key and select the solution. This combination opens the second Solution in the Solution Pad
Open a second instance
To open a second instance of Visual Studio for Mac, open the Terminal application and enter
open -n "/Applications/Visual Studio.app"
Based on #moke and #MilanG answers, I created a bash file on my desktop with this content:
#!/bin/bash
open -n -a "Visual Studio"
osascript -e 'tell application "Terminal" to close first window' & exit
I named this file "Visual Studio".
Then I made the file executable on double-click by following this procedure https://stackoverflow.com/a/5126052/3819725
As a last step, I re-used the Visual Studio icon for the bash file on my desktop so that I instantly know what to click on. I did this:
Right click on the bash file you just created and select "Get Info". An information panel opens with an icon in the top-left corner.
Open a new Finder window and position it next to the "Get Info" panel you just opened
In the Finder window, navigate to "Applications" and select "Visual Studio" from the list of applications.
Right click on the "Visual Studio" application icon and select: "Show Package Contents".
Navigate to "Contents" -> "Resources" and select the "VisualStudio.icns" file.
Drag this file to the icon in the top-left corner of the "Get Info" window you opened in step (1)
Voila - you now have a clickable desktop icon with the visual studio icon that opens a new instance of Visual Studio for Mac and does not leave a Terminal window open.
I am using MSSolutionLauncher for opening multiple instances of Visual studio for Mac. The github page of the project is Here. Download latest release and double click to unzip. Now keep the app in desktop and click on it to open new instance of the Visual studio for mac as many times as you want.
EDIT
Starting from Visual Studio for Mac 2019, MSSolutionLauncher is not required. Keep the VSMac Shortcut in Dock. Right Click the Dock Icon and select New Instance.
Clone the Application!
Open Finder
Navigate To Applications
Select Visual Studio
Edit > Copy
Edit > Paste
Open the copy
Posted my solution here:
https://stackoverflow.com/a/62831584/2621976
just do
open -a "Visual Studio" \
"path to first sln" \
"path to second sln" \
...
Just hit Shift+Command+N (Or go to "File > New Window" and it will open a new window. You can then drag files from one to the other.
I was trying to do the same thing which led me here. I didn't have luck with the highest-rated solution and then the above occurred to me. Unless I'm missing something more to the original request? Seems like the most obvious solution.
This is VS code (not VS4Mac as per comment below). But found this forum in my own search so might be useful.
open -n -a "Visual Studio" gave error "Can't Find Application Visual Studio", so I just did:
Open a visual studio project
To get another, right click (two finger press) on visual studio docked icon
Click "New Window", and now you have two instances

Resources