What triggers notifications of the form "Bell in session Shell" in KDE?

I'm running KDE on Debian Testing.

From time to time, programs running in a terminal (Konsole) trigger system notifications of the form "Bell in session Shell".

What triggers these notifications?

Note: I'm not asking how to disable them - I know there's an option to do so in Konsole -> Settings -> Configure Notifications. I'm asking what behaviour triggers them in the first place, with a view of possibly modifying some of the programs that trigger them to not trigger them, or to trigger them under different conditions.


Solution 1:

I believe this is how konsole terminal emulator interprets bells.

Try to run in bash

sleep 3 && echo -e "\a"

Then switch to another app and wait 3 seconds.

Many many years ago when real terminals were connected to big computers, there was a special protocol called "escape sequences" to send commands to such terminals. There are sequences to change color, move to new line, or ring bell. First terminals were equipped with real bells to notify operator about some long-running task is ended.

Any modern terminal emulator (konsole, xterm, or real console when your are in text mode) simply emulates such terminal hence understands such sequences.

The TERM env. variable tells the name of emulated terminal. Some libs like ncurses then use termcap (or terminfo) file to find which sequence is used for what on this terminal.