How to integrate Cmder properly in VS Code April 2021?
Asked Answered
L

4

5

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?

Leuctra answered 11/5, 2021 at 14:55 Comment(0)
L
15
  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.

Leuctra answered 17/5, 2021 at 13:2 Comment(6)
Replace "terminal.integrated.profile.windows": "Cmder" to "terminal.integrated.defaultProfile.windows": "Cmder"Fibriform
Amazing! I was looking for it all day long <3Rheumatism
Wow this is the answer! Thanks a lotOnyx
You can also use "cmder_mini" , only change "C:\\tools\\cmder" to "C:\\tools\\cmder_mini"Leuctra
My cmder doesn't have the "%CMDER_ROOT%\\vendor\\bin\\vscode_init.cmd" neither the icon. Any guidance on how to grab them?Dicast
@Dicast Just download or copy file form cmder projectBounds
S
0

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)

Scalene answered 12/5, 2021 at 22:36 Comment(0)
B
0

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 :(

Bram answered 14/5, 2021 at 8:0 Comment(0)
B
0

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": ["."],
    },
}
Badge answered 17/6, 2021 at 4:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.