在 VSCode 中配置默认​​ shell 和参数命令的新方法? [英] The new way to configure default shell and argument commands in VSCode?

查看:137
本文介绍了在 VSCode 中配置默认​​ shell 和参数命令的新方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前,我假设微软发布了 VSCode 的新更新,当我开始构建我的 esp idf 项目时,它不起作用,因为它依赖于在特殊"之前从终端运行的命令.执行项目构建命令,我得出的结论是,允许自动执行的以下设置位于设置"中的文件 main.code.workspace 中.分别是:

Few days ago I assume Microsoft released a new update for VSCode and when I came to build my esp idf project it didn't work because it relies on a command to run from the terminal before it's "special" project build command is executed and I came to the conclusion that the following setting that allowed that automatically was in file main.code.workspace in "settings" were:

    "terminal.integrated.shell.windows": "cmd.exe",
    "terminal.integrated.shellArgs.windows": [

        "/k", 
        "C:/Coding/ESP32/esp-idf/export.bat"
    ],

错误如下:

这已被弃用,配置默认 shell 的新推荐方法是在 #terminal.integrated.profiles.osx# 中创建一个终端配置文件,并在 中将其配置文件名称设置为默认值>#terminal.integrated.defaultProfile.osx#.目前,这将优先于新的个人资料设置,但将来会发生变化.

This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in #terminal.integrated.profiles.osx# and setting its profile name as the default in #terminal.integrated.defaultProfile.osx#. This will currently take priority over the new profiles settings but that will change in the future.

在启动时配置默认终端并运行此命令的新方法是什么?

What is the new way to configure the default terminal at startup and run this command?

推荐答案

在settings.json文件中我们需要有以下内容

In the settings.json file we need to have the following

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

并通过添加设置默认终端

And set the default terminal by adding

"terminal.integrated.defaultProfile.windows": "Command Prompt",

我们可以通过按 Ctrl + Shift + P 并搜索终端:选择默认配置文件并选择所需的外壳来实现这一点.

We can achieve this by pressing Ctrl + Shift + P and searching for Terminal: Select Default Profile and selecting the required shell.

但是,虽然已弃用,但您目前的设置现在应该可以使用.

However, although deprecated the setting you have currently should work for now.

这篇关于在 VSCode 中配置默认​​ shell 和参数命令的新方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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