mate-desktop / mate-terminal

The MATE Terminal Emulator
http://www.mate-desktop.org
GNU General Public License v3.0
134 stars 73 forks source link

Wish: support Teminal Bell using the pcspkr #385

Open RichardNeill opened 3 years ago

RichardNeill commented 3 years ago

Expected behaviour

Bell in terminal produces a short, quiet, beep out of the pcspkr hardware.

Actual behaviour

Bell in terminal produces a loud bong out of the desktop speakers. This can be rather startling if you are listening to music at the same time (or you were, and left the volume turned up)

MATE general version

1.24.1

Background.

Many machines (especially desktops) have a hardware speaker or a small piezo mounted on the motherboard. Most laptops don't.

For some users, we can give a much better experience if we allow the terminal do quietly beep the pcspkr rather than a soundcard-beep - it's also slightly lower latency. This is a matter of strong personal preference both ways.

Suggestion:

  1. Offer an option in the settings for "Terminal Bell" either as "notification, through soundcard" or "beep the motherboard piezo".

  2. If the latter is selected, check that the pcspkr device is available (if not, hint that the user needs to remove it from /etc/modprobe.d/blacklist.conf: blacklist pcspkr, and then modprobe pcspkr)

  3. Actually beep. (440Hz, 50ms is a good choice).

Aside:

The way this works in KDE's konsole is that you configure "settings - notifications - bell_in_active_session" to be "run command" and then choose "/usr/bin/beep -f 440 -l 50"

Second aside: the terminal bell is radically more helpful if you do "set show-all-if-ambiguous on" in /etc/inputrc. Most people who turn off the bell do so because of the default tab-completion problem.