summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2021-06-07 15:52:08 +0000
committerchristos <christos@NetBSD.org>2021-06-07 15:52:08 +0000
commitbdde40829c40b4d4476cec9da4cb261c3bc95214 (patch)
tree949146a60fa79c6a1a63530180caf481a1dae248 /sys/dev
parentde152922cfde35028a5f6f210777d5a0832f4d93 (diff)
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 (limited to 'sys/dev')
-rw-r--r--sys/dev/wscons/wsemul_vt100.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/wscons/wsemul_vt100.c b/sys/dev/wscons/wsemul_vt100.c
index 21d010261ef..54ca7ada33c 100644
--- a/sys/dev/wscons/wsemul_vt100.c
+++ b/sys/dev/wscons/wsemul_vt100.c
@@ -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 @@ wsemul_vt100_output_c0c1(struct wsemul_vt100_emuldata *edp, u_char c,
/* 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 @@ wsemul_vt100_output_c0c1(struct wsemul_vt100_emuldata *edp, u_char c,
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