From nobody  Sun Mar  2 23:53:50 1997
Received: (from nobody@localhost)
          by freefall.freebsd.org (8.8.5/8.8.5) id XAA08903;
          Sun, 2 Mar 1997 23:53:50 -0800 (PST)
Message-Id: <199703030753.XAA08903@freefall.freebsd.org>
Date: Sun, 2 Mar 1997 23:53:50 -0800 (PST)
From: sef@kithrup.com
To: freebsd-gnats-submit@freebsd.org
Subject: syscons beeps even if beeping screen is not active
X-Send-Pr-Version: www-1.0

>Number:         2853
>Category:       i386
>Synopsis:       syscons beeps even if beeping screen is not active
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar  3 00:00:01 PST 1997
>Closed-Date:    Mon Aug 3 02:19:15 PDT 1998
>Last-Modified:  Mon Aug  3 02:20:39 PDT 1998
>Originator:     Sean Eric Fagan
>Release:        2.2-970212-GAMMA
>Organization:
Kithrup Enterprises, Ltd.
>Environment:
FreeBSD garth.kithrup.com 2.2-970212-GAMMA FreeBSD 2.2-970212-GAMMA #0: Sat Mar  1 20:40:41 PST 1997     root@garth.kithrup.com:/usr/src/sys/compile/GARTH  i386

>Description:
For some unfathomable reason, syscons had been changed to always beep,
even when the beeping terminal is not currently displayed.  This is
annoying (part of the reason to change screens is to get away from
any annoying output that screen my display), different from the SCO
model (which only beeps if the screen is active), and potentially very
annoying (write a program that beeps continuously, then switch screens).
>How-To-Repeat:
One screen one:  sleep 2 ; echo ^g
Switch to screen two.  Enjoy the beep.

>Fix:
Simplest fix:
diff -u -r1.1.1.1 syscons.c
--- syscons.c   1997/03/01 02:57:01     1.1.1.1
+++ syscons.c   1997/03/03 07:51:21
@@ -3620,9 +3620,8 @@
        blink_screen(cur_console);
        timeout((timeout_func_t)blink_screen, cur_console, hz/10);
     } else {
-       if (scp != cur_console)
-           pitch *= 2;
-       sysbeep(pitch, duration);
+       if (scp == cur_console)
+           sysbeep(pitch, duration);
     }
 }

More complete fix:
diff -u -r1.1.1.1 syscons.c
--- syscons.c   1997/03/01 02:57:01     1.1.1.1
+++ syscons.c   1997/03/03 07:52:51
@@ -3620,9 +3620,14 @@
        blink_screen(cur_console);
        timeout((timeout_func_t)blink_screen, cur_console, hz/10);
     } else {
+#ifdef SC_SANE_BEEP
+       if (scp == cur_console)
+           sysbeep(pitch, duration);
+#else
        if (scp != cur_console)
            pitch *= 2;
        sysbeep(pitch, duration);
+#endif
     }
 }
 
A more complete fix would use sysctl, which I do not currently know
well-enough to write at the moment.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: wosch 
Responsible-Changed-When: Wed Aug 27 14:58:00 PDT 1997 
Responsible-Changed-Why:  
sos is Mr. syscons. 
State-Changed-From-To: open->closed 
State-Changed-By: yokota 
State-Changed-When: Mon Aug 3 02:19:15 PDT 1998 
State-Changed-Why:  
Fixed in syscons.c 1.268 (not in the same way as suggested in the PR, though). 
>Unformatted:
