How to Disable the Fish Shell Bell in WSL: A Step-by-Step Guide

How to Disable the Fish Shell Bell in WSL

This seems to be a “zero day” solution, as I haven’t found the correct answer anywhere else. When running Fish Shell on Windows Subsystem for Linux (WSL), the bell would sound every single time I hit enter.

Solution

Straight to the point:

  1. Edit ~/.config/fish/functions/fish_prompt.fish.
  2. Find the line echo -n \a.
  3. Comment out or delete the \a. It should look like this: echo -n # \a.
  4. Save, exit, and reload Fish (exit and open a new instance).

That’s it!

Details

The \a character is a non-printing character that sounds the bell. Windows then decides to sound the bell.

Based on this closed issue from a long time ago, I found the meaning of \a.

I also found this post which seems to show every solution except the correct one