9

I yet succed this yet but I reinstall my Visual Studio Code and can't add node terminal to it again.

Please not say me I can run with bash also and use powershell. This two default reachable in Vscode.

But I would like change the deafult terminal and change to node terminal. Not powershell and not cmd...

I search very lot of website in this topic but vanish the solution. There is solution. I used at today node terminal in vs code.

So i should see node instead powershell or cmd.

Sorry if explain lot of but I want be very clear...

enter image description here

0

1 Answer 1

10

For an overview of all types of shells used in Visual Studio Code, see this answer.

Custom shell profiles are maintained in the settings.json file; to open it for editing, select Preferences: Open Settings (JSON) from the command palette (Ctrl-Shift-P).

There are platform-specific properties named terminal.integrated.profiles.*, where * is either windows, linux, or osx (macOS).

The properties inside each define shell profiles, i.e. the shells available for running in the integrated terminal via the dropdown menu labeled + (shell-selection dropdown).

Each shell-profile definition:

  • At a minimum requires either a path argument specifying the full path to the shell executable or, on Windows only, a source argument, which can be PowerShell or Git Bash to let VS Code find the appropriate executables.

  • Start-up arguments are specified via args.

  • For all supported properties, see the docs.

To set the default shell profile:

  • Either: use the Terminal: Select Default Profile command from the command palette: a list of all defined profiles will present; select the one of interest.

    • Note: Clicking the cog icon (cog icon) to the right of each profile allows you to define a new profile that is a based on the highlighted one: You're prompted for a name for the new profile, which is then created as a copy of the highlighted profile. Note that no further action is taken as of v1.59 - you must manually open the settings.json file for editing in order to customize the new profile.
  • Or: Set the platform-appropriate terminal.integrated.defaultProfile.* property to the name of the desired shell profile.


Example: Defining Node.js (node.exe) as a custom shell profile on Windows:

  • Determine the full path to node.exe and escape \ characters for JSON by doubling them; e.g., from PowerShell:
# Get node.exe's full path, escape '\' chars., copy to the clipboard.
(Get-Command node.exe).Path.Replace('\', '\\') | Set-Clipboard
  • Add the following to your settings.json file (if the terminal.integrated.profiles.windows property already exists, simply add the Node.js property to it); the example uses node.exe's default installation location, C:\Program Files\nodejs\node.exe.
"terminal.integrated.profiles.windows": {
    "Node.js": {
      "path": "C:\\Program Files\\nodejs\\node.exe",
      "args": [] // Add startup arguments as needed.
    }
  },

// Make Node.js the default shell (if the property already exists, update its value).
"terminal.integrated.defaultProfile.windows": "Node.js",
Sign up to request clarification or add additional context in comments.

7 Comments

Thank you very much. I try interpret that you write. But not work. Not offer "node" integrated terminal via the dropdown menu labeled + Only I do the folowing: 1. Open powershell 2. execution this command:(Get-Command node.exe).Path.Replace('\', '\\') | Set-Clipboard 3. Paste your code to Settings.json that was empty cause I clean cash before (with plus , sign cause this missing between up and botom code)
This is my settings.json file: { "terminal.integrated.profiles.windows": { "Node.js": { "path": "C:\\Program Files\\nodejs\\node.exe", "args": [] // Add startup arguments as needed. } }, // Make Node.js the default shell (if the property already exists, update its value). "terminal.integrated.defaultProfile.windows": "Node.js", }
I restart windows also
Success! I reopen the Visual Studio Code not there Node. But now I open a new folder and now there is! Thank you very much again!
Glad to hear it worked out in the end, @MilánNikolics; my pleasure.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.