当所有扩展都被禁用时,这个问题是否会发生?:是的
- VS Code 版本:1.74.2
- 操作系统版本:Windows 11
重现步骤(在 Windows 上):
- 创建一个
npm
任务,启动脚本。 - 在用户首选项中设置
"terminal.integrated.automationProfile.windows"
为:
"terminal.integrated.automationProfile.windows": {
"path": "nu.exe",
"args": ["-c"],
},
这是一个示例;这也适用于例如 pwsh.exe
/ ["-Command"]
。
- 运行任务。
- VS Code 将运行
nu.exe -c /d /c yarn run name
而不是nu.exe -c "yarn run name"
。
这个问题在 #93437 中被标记为已修复,但实际上并没有。虽然提供了一个解决方法,但在我看来是不可接受的。如果我修改我的 shell 在 用户 设置中,我不应该需要修改那么多用户都会使用的tasks.json
,而且它们的首选 shell 也不同。更重要的是,可以指定一个 shell,所以/bin/sh
对于 Windows 上的用户不起作用,而cmd.exe
/pwsh.exe
/ 无论什么对于 Linux 上的用户都不起作用。这使得terminal.integrated.automationProfile.*
基本上毫无用处。
既然terminal.integrated.automationProfile.*
需要一个args
参数,为什么还要添加不需要的参数呢?我理解为什么默认值可能很好(例如,当path
是pwsh.exe
时,将args
设置为["-Command"]
),但是如果首选项被明确指定,那么如果它们只与单个 shell 一起工作,为什么要在它们后面添加新的参数呢?
3条答案
按热度按时间xwbd5t1u1#
我今天在尝试执行一个shell脚本时遇到了这个问题,版本是1.76.2:
The terminal process "C:\msys64\msys2_shell.cmd -defterm -here -no-start -mingw64 /d /c .TransferBuild.sh" terminated with exit code: 127.
e5nszbig2#
我正在使用MSYS2构建环境和Makefile工具,并且出现了相同的错误:
vscode版本1.77.3
settings.json:
ar7v8xwq3#
版本1.85.1仍然存在这个问题。