How to make console beep?

Backspace at empty prompt in console makes PC-speeker "beep!", also hitting 'Control-G'.
Doing this in KDE-Konsole generates a sound. So far this behaviour is expected.

But all my attempts generating a console-beep in scripts fail.

Doing this

Code:
# echo "^G^G^G"
^G^G^G

just makes no noise on my amd64. Found a lot of stuff how to disable bell, but nothing how to make the bell ring.
 
Code:
# echo -e "\007"
-e \007
does not work with tcsh. Using bash it works. So how could this be done in csh scripts?
 
Maybe I found the reason for the bash/tcsh difference, but I'm not sure about
Code:
> bindkey | grep "\^G" -C1
"^F"           ->  forward-char
"^G"           ->  not defined
"^H"           ->  backward-delete-char
Now I'm struggling for the proper use of bindkey to make ^G bound to bell. If someone knows how to do that, please jump in.
 
If someone is still interested, printf instead of echo works for me (in csh/tcsh), e.g. echo -e "\007" prints -e \007, but printf "\007" makes the console beep. Same with printf "\a". As far as I know, printf "^G" doesn't work.

Hope it helps.
 
I see the bell:

1637456388903.png


– but I don't hear the bell. I found relevant preferences for Konsole, none set to play a sound:

1637456529934.png
– and only one of the listings has a sound:

1637456696654.png
Oxygen-Sys-App-Message.ogg

Code:
% pkg provides Oxygen-Sys-App-Message.ogg
Name    : plasma5-oxygen-5.23.2
Desc    : Plasma5 Oxygen style
Repo    : FreeBSD
Filename: usr/local/share/sounds/Oxygen-Sys-App-Message.ogg
%
 
On the command line, does the <backspace>, <del> or <tab> key produce an audible sound?

No, however there's the bell icon in the tab.

Visual bell enabled, but no inversion of the screen. This smells like maybe a bug in or around Plasma, I might mention it in IRC.
 
No, however there's the bell icon in the tab.

Visual bell enabled, but no inversion of the screen. This smells like maybe a bug in or around Plasma, I might mention it in IRC.
Can you get the bell / beep in a regular (non-X) console?
Recently there was a change that disabled the beeper by default.
Apparently it annoys more people than there are people who need / like it.
See hw.syscons.bell and kern.vt.enable_bell for sc and vt respectively.
 
Code:
root@mowa219-gjp4-8570p-freebsd:~ # sysctl hw.syscons.bell kern.vt.enable_bell
hw.syscons.bell: 1
kern.vt.enable_bell: 0
root@mowa219-gjp4-8570p-freebsd:~ # sysctl kern.vt.enable_bell=1
kern.vt.enable_bell: 0 -> 1
root@mowa219-gjp4-8570p-freebsd:~ # uname -KU
1400043 1400043
root@mowa219-gjp4-8570p-freebsd:~ # uname -a
FreeBSD mowa219-gjp4-8570p-freebsd 14.0-CURRENT FreeBSD 14.0-CURRENT #116 main-n251146-d109559ddbf: Mon Nov 29 14:34:59 GMT 2021     root@mowa219-gjp4-8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG  amd64
root@mowa219-gjp4-8570p-freebsd:~ #

Nothing audible at ttyv1 following the change, should I reboot for the change to take effect?
 
For Konsole,
Settings > Edit Current Profile > General > Terminal bell mode: System Bell

Code:
len@klatest:/usr/home/len $ printf '\007'
len@klatest:/usr/home/len $ pkg info -E plasma5-plasma
plasma5-plasma-5.23.4
len@klatest:/usr/home/len $ freebsd-version
13.0-RELEASE-p5
len@klatest:/usr/home/len $ sysctl hw.syscons.bell
hw.syscons.bell: 1
len@klatest:/usr/home/len $ sysctl kern.vt.enable_bell
kern.vt.enable_bell: 1
len@klatest:/usr/home/len $
 
Back
Top