How to integrate Cmder properly in VS Code April 2021?

Viewed 4281

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?

4 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.

Open PowerShell as admin (right click on start --> Windows PowerShell (Admin))

get-executionpolicy -list

set-executionpolicy unrestricted

set.executionpolicy unrestricted -force (if you get error with command above)

I tried with your settings and any result. Microsoft deprecated the older terminal settings and now any good solution to open with cmder or other commmand line program :(

This works for me with the new VS Code settings.json structure and using Laragon's install of Cmder.

    "cmder": {
        "path": "C:\\Laragon\\bin\\cmder\\cmder.bat",
        "args": ["."],
    },
}
Related