在 Windows 10 上的 WSL 终端中禁用蜂鸣声 [英] Disable beep in WSL terminal on Windows 10

查看:46
本文介绍了在 Windows 10 上的 WSL 终端中禁用蜂鸣声的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Windows 10 上的 WSL 中禁用视觉和音频铃声/哔声?

How to disable visual and audio bell/beep in WSL on Windows 10?

推荐答案

  1. 要在 bash 中禁用哔声,您需要在 中取消注释(或添加,如果还没有的话)set bell-style none/etc/inputrc 文件.

  1. 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 文件:

To disable the beep and the visual bell also in vim you need to add the following to your ~/.vimrc file:

set visualbell
set t_vb=

  • 要在 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 终端中禁用蜂鸣声的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆