Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to integrate Cmder properly in VS Code April 2021?

I would like to integrate Cmder into my Vscode settings but on vscode April 2021 updates the commands "terminal.integrated.shell.windows" and "terminal.integrated.shellArgs.windows" were deprecated.

I'm using VS Code 64bit on Windows, and I tried to modify my settings.json file, to create a Cmder profile as the integrated terminal as follows:

  "terminal.integrated.profiles.windows": {
    "Cmder": {
      "source": "Cmder",
      "overrideName": true,
      "icon": "cmder",
      "env": {"CMDER_ROOT": "C:\\tools\\cmder"},
      "path": "%CMDER_ROOT%\\Cmder.exe",
      "args": ["/K", "%CMDER_ROOT%\\vendor\\bin\\vscode_init.cmd"],
    },
  },
  "terminal.integrated.defaultProfile.windows": "Cmder",

However, the integrated 'Cmder' profile doesn't work and for the command terminal.integrated.defaultProfile.windows": "Cmder", appears that "This setting can be applied only in application user settings".

Anyone else trying to integrate Cmder as a integrated profile of the vscode terminal?

like image 812
emgf_co Avatar asked May 11 '21 14:05

emgf_co


People also ask

How do I run a shell script in VS Code?

Open Visual Studio Code and press and hold Ctrl + ` to open the terminal. Open the command palette using Ctrl + Shift + P . Type - Select Default Shell . Select WSL Bash (NOT Git Bash ) from the options.

How to setup cmder in VSCode in 2021?

How to setup Cmder in VSCode in 2021 1 Download Cmder 2 Save Cmder to C:\ drive 3 Open Settings.json in VSCode 4 Create VSCode Integrated Terminal Settings

How do I use cmder in VS Code?

Tip: refer to here on notes about handling spaces in your path. TL;DR: It's not recommended by the Cmder team, but you may use ^ character before spaces to handle the paths. You don't need to restart VS Code to make this work. Hit Ctrl + ` (Control-Tilde) to open Cmder in VS Code terminal!

What is the use of VSCode_init in cmder?

Cmder 1.3.12 introduced a vscode_init.cmd script which allows VS Code tasks to work correctly with Cmder. The documentation in VS Code, referred to in the answer above, is out of date if you're using a version of Cmder greater than 1.3.11.


Video Answer


1 Answers

  1. Open the User Settings (File -> Preferences -> Settings).
  2. Type terminal.integrated.Profiles.windows and click in Edit in settings.json.
  3. Define the new profile in the terminal and set Cmder as the default profile:
    "terminal.integrated.profiles.windows": {
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell"
        },
        "Command Prompt": {
            "path": [
                "${env:windir}\\Sysnative\\cmd.exe",
                "${env:windir}\\System32\\cmd.exe"
            ],
            "args": [],
            "icon": "terminal-cmd"
        },
        "Git Bash": {
            "source": "Git Bash",
        },
        "Windows PowerShell": {
            "path": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
        },
        "Cmder": {
            "path": [
                "${env:windir}\\Sysnative\\cmd.exe",
                "${env:windir}\\System32\\cmd.exe"
            ],
            "env": {"CMDER_ROOT": "C:\\tools\\cmder"},
            "args": [
                "/K",
                "%CMDER_ROOT%\\vendor\\bin\\vscode_init.cmd"
            ],
            "icon": "cmder",
        }
    },
    "terminal.integrated.defaultProfile.windows": "Cmder",
  1. Open a new terminal (Terminal -> New Terminal)

Make sure that your Cmder directory exist into C:\tools

And enjoy.

like image 164
emgf_co Avatar answered Oct 19 '22 17:10

emgf_co