Bug 407821 - Terminal bell does not trigger system (visual) bell
Summary: Terminal bell does not trigger system (visual) bell
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 18.04.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 412840 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-05-22 08:43 UTC by Ralf Jung
Modified: 2020-12-30 02:29 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Jung 2019-05-22 08:43:27 UTC
SUMMARY

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.

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

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

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


SOFTWARE/OS VERSIONS
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


ADDITIONAL INFORMATION
Comment 1 Juraj 2019-06-08 17:55:36 UTC
Hello,

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.
https://www.x.org/releases/X11R7.5/doc/man/man3/XkbBell.3.html
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:
BellMode=2

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

https://invent.kde.org/utilities/konsole/commit/de9e92b81f57723c6578aed2c991b653243359f5