Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Windows Terminal on VS code

All in title. Also i'm russian and this is Google Translate. I opened the process in Task Manager and went to the file location. There was an error with access denial, but it was solved with the help of Computer Control. But I don't know how to open this particular terminal in vs code. I introduced OpenConsole first.Yes, but it was only a terminal. But that's what I'm interested in.
SCREENSHOT

like image 766
Ozballer31 Avatar asked Dec 16 '19 12:12

Ozballer31


1 Answers

I think you want to launch the new Windows Terminal from within VS Code.

What you need to do is edit your USER settings.json, and locate the line that associates an editor with the integrated Windows terminal (there are three built-in editors that you can redefine:

  • Windows (cmd or PowerShell)
  • Windows Subsystem for Linux (wsl)
  • Linux (xterm)

):

"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",

If you REPLACE this by:

"terminal.integrated.shell.windows": "C:\\Users\\<your_user_name>\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe",

... then your Windows Terminal will pop up rather than the cmd integrated console. But it will be in a separate window (not in the VS Code pane); I am not aware of any method on how to start Windows Terminal in integrated mode...

If it is however your intention to replace the usual cmd terminal by a PowerShell, then you can follow the instructions from Fran6.

A more graphical method is go to your existing VS Code terminal, and go to the drop down to select one of multiple terminals you might have launched. Below your existing terminals, there is an option to 'Select Default Shell':

enter image description here

When you select this option, this will take you straight to the options available to change to your preferred integrated shell:

enter image description here

When you now hit the + next to the dropdown, you can accumulate as many shells as you want, of any type that you want; Here is an example of 2 cmd shells, 1 PowerShell, and one wsl shell:

enter image description here

Update (May 2021):

The terminal.integrated.shell.windows setting is now deprecated.

You should add a profile to terminal.integrated.profiles.windows. For example:

    terminal.integrated.profiles.windows": {
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell"
        },
        "Command Prompt": {
            "path": "C:\\WINDOWS\\System32\\cmd.exe"
        },
        "wt": {
            "path": "C:\\Users\\<your_user_name>\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe"
        },
    },

Then set it as default:

"terminal.integrated.defaultProfile.windows": "wt",
like image 110
Flandraco Avatar answered Sep 22 '22 07:09

Flandraco