Disable beep in WSL terminal on Windows 10
BashWindows 10Windows Subsystem-for-LinuxBash Problem Overview
How to disable visual and audio bell/beep in WSL on Windows 10?
Bash Solutions
Solution 1 - Bash
-
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.
Solution 2 - Bash
Since the only noise terminals tend to make is the bell and if you want it off everywhere, the very simplest way to do it for bash on Windows:
- Mash backspace a bunch at the prompt
- Right click sound icon and choose Open Volume Mixer
- Lower volume on Console Window Host to zero
Solution 3 - Bash
Uncommenting set bell-style none
in /etc/inputrc
and creating a .bash_profile
with setterm -blength 0
didn't stop vim from beeping.
What worked for me was creating a .vimrc
file in my home directory with set visualbell
.
Source: https://linuxconfig.org/turn-off-beep-bell-on-linux-terminal
Solution 4 - Bash
You need add following lines to bash and vim config,
-
Turn off bell for bash
vi ~/.inputrc set bell-style none
-
Turn off bell for vi
vi ~/.vimrc set visualbell set t_vb=
Setting the visual bell turns off the audio bell and clearing the visual bell length deactivates flashing.
Solution 5 - Bash
its not specific to bash windows 10. but if you want remove the bell terminal for zsh, just use the right option in zshrc. (for vim, answer already posted)
unsetopt beep
http://zsh.sourceforge.net/Doc/Release/Options.html
i have find this option quickly, but would find it even faster if its was on this post ^^
hf
Solution 6 - Bash
Replace in System Sounds the "Critical Stop" to a wav-file which is silent 1.
Just removing the sound completely did not work for me. Apparently some default sound was used in this case.
(Credits for this.lau_ on SuperUser for discovering this).
Solution 7 - Bash
I found that TedMilker's solution worked, but I would need to readjust the Volume Mixer each time I restarted. To make it permanent, I adjusted volume levels within the Windows App Volume and Device Preferences.
Taken from this post:
Settings / System / Sound / App volume and device preferences
Set Console Window Host to Zero.
(You may need to hit Tab / Backspace in the console window to trigger the bell sound before the Console Window Host slider appears.)
Solution 8 - Bash
In Windows Terminal Settings, select the profile, then click 'advanced' > 'bell notification'
and turn it off:
Solution 9 - Bash
In addition to what jgr208 said, you may have a ~/.profile
file already and ~/.bash_profile
may not be present, as was the case with me.
In this case, add setterm -blength 0
to the .profile
.
If you create a .bash_profile
, your .profile
will be ignored and anything Windows wrote there will not work.
Solution 10 - Bash
To disable the beeps when ssh-ing in a remote machine, simply create the same ~/.inputrc
and ~/.vimrc
files on the remote machine to stop ssh itself from beeping.
See the answer from @Nemo for the contents of each file.
Solution 11 - Bash
Find the location of the .bash_profile
file and enter the following into the file:
setterm -blength 0
Which will set the amount of time the beep happens to 0 and thus no beep.