preface

At 2021-9-6, when I saw the option of restart and update in the lower left corner of the setting button, I updated vsCode. When I opened it again, I found that my CMDER was invalid. At this time, I immediately thought of Baidu’s “how to use CMder in vsCode” and “CMDER is invalid in the latest version of vsCode”. I did find some blogs and solutions, but I wanted to know why and what to do from the official documentation, so I went to the cmder official documentation (github.com/cmderdev/cm…). Which details how cmder is integrated into vsCode

Before installing, download Cmder first

Cmder official download address (github.com/cmderdev/cm…) , here is the historical version, as well as the updated content of each version, it is recommended to download the latest version V1.3.18

Configuration of earlier Versions

In previous versions, you only needed to configure the following three lines in vsCode’s json Settings file:

    "git.enabled": true,
    "git.path": "[cmder_root]\\vendor\\git-for-windows\\cmd\\git.exe",
    "terminal.integrated.shell.windows": "[cmder_root]\\vendor\\git-for-windows\\bin\\bash.exe",
Copy the code

Note that [cmder_root] refers to the file path of the cmder installation package, such as my address: D:\Software\cmder

In addition, for Windows users, you need to change all \\ configured in line 3 to \\, that is, you need to change D:\Software\cmder to D:\Software\cmder

New Version Configuration

After opening the updated vsCode, the above configuration will prompt the following:

Only need to delete the terminal. Integrated. Shell. Windows (or delete or not affected), at the same time, the new configuration code is as follows:

"git.enabled": true, "git.path": "[cmder_root]\\vendor\\git-for-windows\\cmd\\git.exe", "terminal.integrated.profiles.windows": { "cmder": { "path": "C:\\WINDOWS\\System32\\cmd.exe", "args": ["/K", "[cmder_root]\\vendor\\bin\\vscode_init.cmd"] } } "terminal.integrated.defaultProfile.windows":"cmder", // This value is the name of profils.window above 'cmder'Copy the code

If you do not have vscode_init. CMD in the cmder directory, go to the cmder website to update the cmder to version 1.3.18 or later, and download the original cmder file.

Recommended reading

Cmder official documentation: github.com/cmderdev/cm…