2

Like many other people, I dislike the standard error sound that Windows makes when auto-complete fails or when return is hit on an empty line in the WSL bash. Info: Windows 10 Edu, WSL2 with Ubuntu 20.04.

However, I don't want to eliminate it- I want to change it. I can only find tricks to eliminate it either via Sound Mixer or editing the inputrc file. There is one answer saying I can change the whole sound, which is of course not what I want. I would like a custom sound for WSL bash, and the rest to remain Win-default.

Is this possible? Perhaps registry or something within WSL itself?

I found the sounds under /usr/share/sounds/freedesktop/stereo, which has the bell.oga file which is what I would like to use. I installed gnome-tweaks which is where I'd adjust this on Ubuntu; but I haven't gotten the GUI within WSL2 working yet. Either way I am unsure whether any setting within WSL affects that Windows treats the WSL bash as just another "console host window". I'd appreciate any leads on this!

2 Answers 2

2

For older Windows releases, WSL uses the legacy "Windows Console Host" as the terminal. To change the bell sound in Windows Console Host, change the Critical Stop sound as mentioned in @StaceyRichards' answer.

For fresh-installs of Windows 10 22H2 and later, the default for WSL should now be Windows Terminal. As I mention in this answer, you can now change the bell sound in Windows Terminal using the profile.bellSound setting. You can also disable the bell entirely or (as @MaxStarkenburg mentioned in the comments) change it to a visual bell/flash.

Other alternatives

These were part of my original answer, but with this feature now in Windows Terminal, that would be my preferred solution:

  • Hyper is another terminal app for Windows which can run WSL. I see that there's a "BellURL" option in its config, but I can't find any documentation on how it works. Might be worth checking out, though.

  • You can also now use Linux GUI Terminal Applications if you'd like with WSLg. I'm guessing that some of these would have a setting for the this.

3
  • 1
    Between your pointing out that this is called a bell and your passing mention of the ability to use a visual one instead, I was able to find the option to replace the sound with the "Flash window" option (under the "Advanced" section of the Ubuntu settings in the Terminal app), which feels a million times better than that sound. Thank you! Commented Sep 19, 2022 at 1:19
  • @MaxStarkenburg Thanks for the prompt! More than a year after my answer and I still hadn't tried the visual-bell (flash window) myself! Trying it out now. Commented Sep 19, 2022 at 22:13
  • I perhaps spoke too soon and after a while yesterday found even the flash a bit annoying, haha (still far better than the sound!) and switched to just "Flash taskbar" for now, which I barely notice, but that's fine by me, and I appreciate your answer all the same. Commented Sep 20, 2022 at 3:29
1

Go to Control Panel > Change System Sounds.

In the Sounds tab of the Sound dialog select the Critical Stop tree item in the Program Events section.

Drop down the Sounds selection box and select something other than Windows Background.wav, or browse and select you own wav file.

This will change the sound of the Critical Stop so if you don't want to do that, then this isn't the answer for you.

Change Critical Stop sound

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .