How do I stop the Linux terminal in Windows from making the error sound?

If I'm in an empty Linux terminal in Windows (using the Windows Subsystem for Linux), and I hit backspace, I hear this annoying error-like sound. My Windows computer used to do this, but then I turned it off. How do I turn off this sound?


Solution 1:

If you want to stop bash generating error sounds without affecting other Windows programs, type the following:

bind 'set bell-style none'

If you want a permanent change, add it to the end of ~/.bashrc.

Solution 2:

Here using the WLS (Ubuntu for Windows) I had to edit at:

/etc/inputrc

Just run it and restart the terminal

echo 'set bell-style none' >> /etc/inputrc