Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/wscons PR/56223: David Shao ^[]8;;^G make console un...



details:   https://anonhg.NetBSD.org/src/rev/fdb62aabd39c
branches:  trunk
changeset: 983804:fdb62aabd39c
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jun 07 15:52:08 2021 +0000

description:
PR/56223: David Shao ^[]8;;^G make console unresponsive. From OpenBSD:
In `string' state, accept bell (^G) as an end of sequence in addition to
`ESC \', as supported by xterm; some third-party software such as
ncmpcpp rely upon this.

diffstat:

 sys/dev/wscons/wsemul_vt100.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (42 lines):

diff -r b00b94ea291c -r fdb62aabd39c sys/dev/wscons/wsemul_vt100.c
--- a/sys/dev/wscons/wsemul_vt100.c     Mon Jun 07 14:24:42 2021 +0000
+++ b/sys/dev/wscons/wsemul_vt100.c     Mon Jun 07 15:52:08 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsemul_vt100.c,v 1.46 2019/11/10 21:16:38 chs Exp $ */
+/* $OpenBSD: wsemul_vt100.c,v 1.28 2011/08/04 04:18:42 miod Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100.c,v 1.46 2019/11/10 21:16:38 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100.c,v 1.47 2021/06/07 15:52:08 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_wsmsgattrs.h"
@@ -429,7 +429,13 @@
                /* ignore */
                break;
        case ASCII_BEL:
-               wsdisplay_emulbell(vd->cbcookie);
+               if (edp->state == VT100_EMUL_STATE_STRING) {
+                       /* acts as an equivalent to the ``ESC \'' string end */
+                       wsemul_vt100_handle_dcs(vd);
+                       edp->state = VT100_EMUL_STATE_NORMAL;
+               } else {
+                       wsdisplay_emulbell(vd->cbcookie);
+               }
                break;
        case ASCII_BS:
                if (vd->ccol > 0) {
@@ -489,7 +495,7 @@
                break;
        case ST: /* string end 8-bit */
                /* XXX only in VT100_EMUL_STATE_STRING */
-               wsemul_vt100_handle_dcs(edp);
+               wsemul_vt100_handle_dcs(vd);
                edp->state = VT100_EMUL_STATE_NORMAL;
                break;
 #endif



Home | Main Index | Thread Index | Old Index