如何在 VS Code 2021 年 4 月正确集成 Cmder? [英] How to integrate Cmder properly in VS Code April 2021?

查看:80
本文介绍了如何在 VS Code 2021 年 4 月正确集成 Cmder?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 Cmder 集成到我的 Vscode 设置中,但在 2021 年 4 月的 vscode 上更新了命令terminal.integrated.shell.windows";和terminal.integrated.shellArgs.windows"已弃用.

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.

我在 Windows 上使用 VS Code 64 位,我尝试修改我的 settings.json 文件,以创建 Cmder 配置文件作为集成终端,如下所示:

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",

但是,集成的Cmder"配置文件不起作用,并且对于命令 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".

还有其他人试图将 Cmder 集成为 vscode 终端的集成配置文件吗?

Anyone else trying to integrate Cmder as a integrated profile of the vscode terminal?

推荐答案

  1. 打开用户设置(文件 -> 首选项 -> 设置).
  2. 输入 terminal.integrated.Profiles.windows 并点击 Edit in settings.json.
  3. 在终端中定义新配置文件并将Cmder设置为默认配置文件:
  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. 打开一个新终端(终端 -> 新终端)

确保您的 Cmder 目录存在于 C:\tools

Make sure that your Cmder directory exist into C:\tools

享受.

这篇关于如何在 VS Code 2021 年 4 月正确集成 Cmder?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆