summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorray <ray@FreeBSD.org>2014-10-07 18:47:53 +0000
committerray <ray@FreeBSD.org>2014-10-07 18:47:53 +0000
commit919850542e70c0c478f7f60a1b41d1e22d174a4f (patch)
tree2cf783ae9c9a9f03fc220fac0f02feba9a8102f1
parenta399990c478a05077c7a376d3ba3d49f420213e3 (diff)
downloadFreeBSD-src-919850542e70c0c478f7f60a1b41d1e22d174a4f.zip
FreeBSD-src-919850542e70c0c478f7f60a1b41d1e22d174a4f.tar.gz
Allow vt(4) to disable terminal bell with `sysctl kern.vt.bell_enable=0`,
similar as syscons(4) do. Submitted by: Tiwei Bie <btw@mail.ustc.edu.cn> MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
-rw-r--r--sys/dev/vt/vt_core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c
index 67d4348..487a7ce 100644
--- a/sys/dev/vt/vt_core.c
+++ b/sys/dev/vt/vt_core.c
@@ -120,6 +120,7 @@ const struct terminal_class vt_termclass = {
static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD, 0, "vt(9) parameters");
VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as Alt)");
+VT_SYSCTL_INT(enable_bell, 1, "Enable bell");
VT_SYSCTL_INT(debug, 0, "vt(9) debug level");
VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode");
VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend");
@@ -904,6 +905,9 @@ vtterm_bell(struct terminal *tm)
struct vt_window *vw = tm->tm_softc;
struct vt_device *vd = vw->vw_device;
+ if (!vt_enable_bell)
+ return;
+
if (vd->vd_flags & VDF_QUIET_BELL)
return;
@@ -915,6 +919,9 @@ vtterm_beep(struct terminal *tm, u_int param)
{
u_int freq, period;
+ if (!vt_enable_bell)
+ return;
+
if ((param == 0) || ((param & 0xffff) == 0)) {
vtterm_bell(tm);
return;
OpenPOWER on IntegriCloud