Search code examples
visual-studio-codecmder

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?


Solution

    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.