Having a Linux Bash on Windows 10 is pretty cool, but as far as I've got to struggle with the not-so-good terminal provided from Microsoft I'm gonna get stuck with Ubuntu for everything.
Anyway, is there a way to turn off that beep whenever you do something on the Bash?
Since it is not possible to comment out bell-style audible
because is not there, nor is it possible to launch sc config beep start= disabled
This question is related to
bash
windows-10
windows-subsystem-for-linux
right click on sound icon (bottom right) >>> open volume mixer >>> mute console window host
@Andrea Tulimiero 's answer works for local, but when you ssh to a remote server, the beep turns on again. My suggestion is to disable from the Windows 10 taskbar. There is volume mixer in the right bottom corner, which works for me.
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.
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.
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
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.
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
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:
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.)
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.
Source: Stackoverflow.com