• 请不要在回答技术问题时复制粘贴 AI 生成的内容
Kasumi20
V2EX  ›  程序员

VS Code 更新了,可以愉快地 Ctrl+C 了

  •  
  •   Kasumi20 ·
    develon2015 · Feb 15, 2022 · 4627 views
    This topic created in 1563 days ago, the information mentioned may be changed or developed.

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

    "terminal.integrated.autoReplies": {
      "Terminate batch job (Y/N)?": "Y\r"
    }
    

    8 replies    2022-02-17 11:08:58 +08:00
    gadfly3173
        1
    gadfly3173  
       Feb 15, 2022
    附加中文版:"终止批处理操作吗(Y/N)?": "Y\r",
    proxytoworld
        2
    proxytoworld  
       Feb 15, 2022
    优秀
    loading
        3
    loading  
       Feb 15, 2022
    我看成了 bitch job...

    我只会看这种英文:kill the *.bat ?
    lizhenda
        4
    lizhenda  
       Feb 15, 2022
    不错不错~我去试试
    weixiangzhe
        5
    weixiangzhe  
       Feb 16, 2022
    可以可以,之前用 linux 也有这个问题,挺烦人的
    uTuw2C6uf964Kx6o
        6
    uTuw2C6uf964Kx6o  
       Feb 16, 2022
    啥意思,我 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
    marcong95
        7
    marcong95  
       Feb 16, 2022
    @mrant #6 你看都没看明白就贴进去了吗,万一是恶意代码咋办。。。这个例子是 Windows 用的,Mac 用户就不用凑热闹了,你要是在 Windows 下用过 Node.js 之类的话就懂的都懂了。。。
    uTuw2C6uf964Kx6o
        8
    uTuw2C6uf964Kx6o  
       Feb 17, 2022
    @marcong95 #7 我擦,感谢提醒
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2550 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 15:59 · PVG 23:59 · LAX 08:59 · JFK 11:59
    ♥ Do have faith in what you're doing.