在Windows 10上禁用Linux Bash的提示音

编程入门 行业动态 更新时间:2024-10-28 14:34:49
本文介绍了在Windows 10上禁用Linux Bash的提示音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在 Windows 10 上具有Linux Bash 非常酷,但是据我所知,我不得不与Microsoft提供的效果不佳的终端进行斗争我将在所有方面都陷于Ubuntu. 无论如何,当您在Bash上执行某项操作时,是否有办法关闭该哔哔声? 由于不可能注释掉bell-style audible,因为它在那里,所以也不可能启动sc config beep start= disabled

Having a Linux Bash on Windows 10 is pretty cool, but as far as I've got to struggle with the not-so-good terminal provided from Microsoft I'm gonna get stuck with Ubuntu for everything. Anyway, is there a way to turn off that beep whenever you do something on the Bash? Since it is not possible to comment out bell-style audible because is not there, nor is it possible to launch sc config beep start= disabled

推荐答案

  • 要在 bash 中禁用蜂鸣声,您需要在/etc/inputrc文件中的第set bell-style none行中取消注释(或添加注释).

  • To disable the beep in bash you need to uncomment (or add if not already there) the line set bell-style none in your /etc/inputrc file.

    注意:由于它是受保护的文件,因此您需要成为特权用户才能对其进行编辑(即,使用sudo <editor> /etc/inputrc之类的东西启动文本编辑器).

    Note: Since it is a protected file you need to be a privileged user to edit it (i.e. launch your text editor with something like sudo <editor> /etc/inputrc).

    要在 vim 中也禁用蜂鸣声,则需要在~/.vimrc文件中添加set visualbell.

    To disable the beep also in vim you need to add set visualbell in your ~/.vimrc file.

    要在 less 中也禁用蜂鸣声(即在手册页中以及使用"git diff"时),则需要在~/.profile文件中添加export LESS="$LESS -R -Q".

    To disable the beep also in less (i.e. also in man pages and when using "git diff") you need to add export LESS="$LESS -R -Q" in your ~/.profile file.

  • 更多推荐

    在Windows 10上禁用Linux Bash的提示音

    本文发布于:2023-07-11 08:52:40,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1093487.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:提示音   Windows   Bash   Linux

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!