Search code examples
terminalvisual-studio-codecmder

Visual Studio Code new config setting in terminal profiles using Cmder


I am trying to integrate cmder into visual studio code as the default terminal, I used to configure like this in my settings.json.

{
  "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
  "terminal.integrated.shellArgs.windows": [
      "/k",
      "C:\\Program Files\\cmder\\vendor\\init.bat"
  ],
}

But now visual code is telling me this configuration is deprecated.

enter image description here

So, I started to investigate VSC documentation, and it is saying I should import like this:

{
  "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"
    },
    "Cmder": {
      "path": "C:\\Program Files\\cmder\\vendor\\init.bat"
    }
  },
  "terminal.integrated.defaultProfile.windows": "Cmder"
}

But it is not working... is starts opening the terminal but closes immediately. Is there something I am missing?


Solution

  • You could try like this (leave the rest unchanged):

    ...
    "Cmder": {
          "path": "C:\\WINDOWS\\SysWOW64\\cmd.exe",
          "args": ["/k", "C:\\Program Files\\Cmder\\vendor\\init.bat"]
        }
    ...
    

    Alternatively, you can also try with:

    • these paths:
      • "C:\\Windows\\Sysnative\\cmd.exe"
      • "C:\\Windows\\System32\\cmd.exe"
    • these args:
      • ["/k", "C:\\PROGRA~2\\Cmder\\vendor\\init.bat"]
      • ["/k", "C:\\Program Files^ (x86)\\Cmder\\vendor\\init.bat"]
      • one of the above in a single string instead of two