Bug 407821

Summary: Terminal bell does not trigger system (visual) bell
Product: [Applications] konsole Reporter: Ralf Jung <post>
Component: generalAssignee: Konsole Developer <konsole-devel>
Severity: normal CC: a.samirh78, jurajoravec, mglb, nate, tim.baverstock
Priority: NOR    
Version: 18.04.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Ralf Jung 2019-05-22 08:43:27 UTC

I have configured my system to enable a "visual bell" (in the KDE system settings), because I often work with the sound turned off so I wouldn't otherwise notice these bells.

This works fine e.g. in emacs or gnome-terminal. However, Konsole seems to never trigger this bell.

1. Enable "visual bell" in KDE system settings.
2. Open a terminal.
3. Hit "delete" without having typed anything into the prompt.

Nothing happens (I guess a sound is played but I have the system muted).

A visual bell should be triggered. This happens when I do the exact same thing in gnome-terminal (in a KDE session).

Operating System: Debian GNU/Linux 10
KDE Plasma Version: 5.14.5
Qt Version: 5.11.3
KDE Frameworks Version: 5.54.0
Kernel Version: 4.19.0-5-amd64
OS Type: 64-bit

Comment 1 Juraj 2019-06-08 17:55:36 UTC

Have you checked?:
Menu > Settings > Configure Notifications...
 - Bell in Focused Session
 - Bell in Unfocused session
Comment 2 Ralf Jung 2019-06-09 09:08:55 UTC
I have seen that, yes. There is no option "trigger system bell" there that I can see.
Comment 3 Christoph Feck 2019-06-25 17:23:43 UTC
"kcmshell5 kcmaccess" (or use the systemsettings application to find this page).
Comment 4 Ralf Jung 2019-06-25 18:17:33 UTC
Yes I know how to configure what happens when the system bell gets triggered. It flashes the window, inverting it 100ms.  But Konsole does not trigger that bell.

I have described the steps to reproduce and the observed and expected result in my original report. Which part is not clear?
Comment 5 Mariusz Glebocki 2019-11-04 02:21:52 UTC
To make it work Konsole should call XkbBell() when BEL code is received.
Comment 6 Mariusz Glebocki 2019-11-04 02:22:03 UTC
*** Bug 412840 has been marked as a duplicate of this bug. ***
Comment 7 fire f. 2019-12-17 14:37:38 UTC
I struggled with this as well. Very complicated! had to remove non-connected bluetooth audiodevices and reboot. finally it works as kinda expected.  should be simpler so as to not be unaware of big issues because audio notifications kinda drop dead.
Comment 8 Ahmad Samir 2020-04-20 20:16:48 UTC
While digging around for something else I stumbled upon https://cgit.kde.org/konsole.git/tree/src/Enumeration.h#n106

It's not exposed in the edit profile dialog; you can edit ~/.local/share/konsole/<profile name>.profile, under the "[Terminal Features]" group add:

start a new konsole window and test:
tput bel
Comment 9 Ralf Jung 2020-04-21 09:05:21 UTC
> BellMode=2

Interesting option, thanks! This still does not trigger a system bell, but it means that Konsole manually replicates the behavior of the system bell (if that is set to flash, too).

Of course, it would be much better if Konsole could just respect my global configuration.
Comment 10 Ahmad Samir 2020-04-21 09:19:34 UTC
That would make the terminal flash, for other options, from the link I posted:
    enum BellModeEnum {
        /** trigger system beep. */
        SystemBeepBell = 0,
        /** trigger system notification. */
        NotifyBell = 1,
        /** trigger visual bell(inverting the display's colors briefly). */
        VisualBell = 2,
        /** No bell effects */
        NoBell = 3

Remember you need to launch a new konsole after editing the .profile manually.
Comment 11 Ralf Jung 2020-04-21 09:46:15 UTC
What is missing from that list is "call XkbBell", which seems to be the standard way of triggering the system bell in X11.
(I tried SystemBeepBell, but it doesn't seem to do that.)
Comment 12 Kurt Hindenburg 2020-12-30 02:29:38 UTC
Git commit de9e92b81f57723c6578aed2c991b653243359f5 by Kurt Hindenburg, on behalf of Ahmad Samir.
Committed on 30/12/2020 at 02:20.
Pushed by hindenburg into branch 'master'.

EditProfileDialog: add GUI to change the terminal bell mode

The feature has been in the profile settings for a long time, but without
being exposed in the UI.
Related: bug 425759

M  +12   -0    src/widgets/EditProfileDialog.cpp
M  +18   -0    src/widgets/EditProfileGeneralPage.ui