终端现在有一个选择功能,当收到一个特定的字符序列时自动回复。一个很好的例子是,在运行批处理脚本时,点击 Ctrl+C 后,会显示 Windows 批处理脚本信息 Terminate batch job (Y/N)? 为了让终端在 Windows 的 Ctrl+C 时自动回复 Y 和回车(\r ),请添加以下设置。
"terminal.integrated.autoReplies": {
"Terminate batch job (Y/N)?": "Y\r"
}

终端现在有一个选择功能,当收到一个特定的字符序列时自动回复。一个很好的例子是,在运行批处理脚本时,点击 Ctrl+C 后,会显示 Windows 批处理脚本信息 Terminate batch job (Y/N)? 为了让终端在 Windows 的 Ctrl+C 时自动回复 Y 和回车(\r ),请添加以下设置。
"terminal.integrated.autoReplies": {
"Terminate batch job (Y/N)?": "Y\r"
}

|
gadfly3173Feb 15, 2022
1
附加中文版:"终止批处理操作吗(Y/N)?": "Y\r",
|
|
proxytoworldFeb 15, 2022
2
优秀
|
|
loadingFeb 15, 2022
3
我看成了 bitch job...
我只会看这种英文:kill the *.bat ? |
|
lizhendaFeb 15, 2022
4
不错不错~我去试试
|
|
weixiangzheFeb 16, 2022
5
可以可以,之前用 linux 也有这个问题,挺烦人的
|
|
uTuw2C6uf964Kx6oFeb 16, 2022
6
啥意思,我 Mac 添加到 setting 之后,执行 cmd c ,报:
"terminal.integrated.autoReplies": { "Terminate batch job (Y/N)?": "Y\r" }Y zsh: command not found: terminal.integrated.autoReplies: zsh: no such file or directory: Terminate batch job (Y/N)?: zsh: command not found: }Y |
|
marcong95Feb 16, 2022
7
@mrant #6 你看都没看明白就贴进去了吗,万一是恶意代码咋办。。。这个例子是 Windows 用的,Mac 用户就不用凑热闹了,你要是在 Windows 下用过 Node.js 之类的话就懂的都懂了。。。
|
|
uTuw2C6uf964Kx6oFeb 17, 2022
8
@marcong95 #7 我擦,感谢提醒
|