如何在Windows 10上禁用WSL中的可视和音频铃声/蜂鸣声?


当前回答

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. 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). 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= 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.

其他回答

找到.bash_profile文件的位置,并在文件中输入以下内容:

设置项 -长度 0

它会将哔哔声发生的时间设置为0,因此没有哔哔声。

您需要添加以下行bash和vim配置,

1)把铃声关掉

vi ~/.inputrc
set bell-style none

2)关闭vi的铃声

vi ~/.vimrc
set visualbell
set t_vb=

设置视觉铃声将关闭音频铃声,清除视觉铃声长度将禁用闪烁。

要在远程机器中禁用ssh时的哔哔声,只需创建相同的~/。输入和~/。远程计算机上的Vimrc文件,以阻止SSH本身发出哔哔声。

每个文件的内容请看@Nemo的回答。

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. 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). 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= 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的。 但是如果您想删除zsh的钟形终端,只需使用zshrc中的正确选项。(对于vim,答案已经发布)

unsetopt beep

http://zsh.sourceforge.net/Doc/Release/Options.html

我很快就找到了这个选项,但如果它在这个帖子上,我会更快地找到它^^

hf