Disable beep in WSL terminal on Windows 10

BashWindows 10Windows Subsystem-for-Linux

Bash Problem Overview


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

Bash Solutions


Solution 1 - Bash

  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.

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

  2. 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=
    
  3. 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:

  1. Mash backspace a bunch at the prompt
  2. Right click sound icon and choose Open Volume Mixer
  3. 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,

  1. Turn off bell for bash

    vi ~/.inputrc set bell-style none

  2. 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.

System sounds configuration

(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:

enter image description here

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAndrea TulimieroView Question on Stackoverflow
Solution 1 - BashAndrea TulimieroView Answer on Stackoverflow
Solution 2 - BashTedMilkerView Answer on Stackoverflow
Solution 3 - BashMWin123View Answer on Stackoverflow
Solution 4 - BashNemoView Answer on Stackoverflow
Solution 5 - Bashuser6637002View Answer on Stackoverflow
Solution 6 - BashJuha PalomäkiView Answer on Stackoverflow
Solution 7 - BashGobiJerboaView Answer on Stackoverflow
Solution 8 - BashPhoenix ZouView Answer on Stackoverflow
Solution 9 - BashraisinrisingView Answer on Stackoverflow
Solution 10 - BashRomain PokrzywkaView Answer on Stackoverflow
Solution 11 - Bashjgr208View Answer on Stackoverflow