如何在Windows 10的WSL中禁用视听铃声/哔哔声?
How to disable visual and audio bell/beep in WSL on Windows 10?
推荐答案
要在 bash 中禁用蜂鸣声,您需要在中取消注释(或添加(如果没有的话)添加)行 set bell-style none /etc/inputrc 文件.
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"时),则需要添加 export LESS ="$ LESS -R-Q"在您的〜/.profile 文件中.
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的WSL终端中禁用提示音
发布评论