【问题标题】:Skip VS Code terminal shell arguments for launch.json跳过 launch.json 的 VS Code 终端 shell 参数
【发布时间】:2019-05-06 15:53:17
【问题描述】:

在我的工作区设置中

{
  "terminal.integrated.shellArgs.linux": [
    "-c",
    "yarn custom_shell"
  ],
}

它会启动一个自定义 shell,在启动时提示用户输入。

当我创建使用集成终端启动的launch.json 配置时,我的yarn custom_shell 命令将运行并等待输入,从而导致 VS Code 提供的启动命令无法运行。在我的集成终端中启动程序的扩展也会出现同样的问题。

当它是一个交互式用户 shell,而不是由扩展或 launch.json 配置启动的 shell 时,有没有办法用terminal.integrated.shellArgs 启动集成终端

【问题讨论】:

    标签: visual-studio-code vscode-settings vscode-tasks


    【解决方案1】:

    我认为一个好的解决方案是让集成的 shell 保持预期的行为,并使用shell-launcher 扩展来破解 vscode 中的不同 shell(它还可以让您无需在自定义 shell 中等待用户输入):

      "shellLauncher.shells.linux": [
          {
              "shell": "bash",
              "args": ["-c yarn custom_shell"],
              "label": "my_custom_yarn_shell"
          }
      ]
    

    【讨论】:

    • 这是一个很好的解决方案。在接受您的回答之前,我会等着看是否发布了本机解决方案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-12-11
    • 2022-08-11
    • 2021-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-19
    相关资源
    最近更新 更多