-actually reset the terminal emulator on close()

-add a callback to reset the terminal emulator by keyboard command
This commit is contained in:
drochner 1999-01-14 11:40:58 +00:00
parent 18ceacdd32
commit 624d9f505f
2 changed files with 28 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wscons_callbacks.h,v 1.5 1998/08/02 14:18:07 drochner Exp $ */
/* $NetBSD: wscons_callbacks.h,v 1.6 1999/01/14 11:40:58 drochner Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -48,6 +48,7 @@ void wsdisplay_set_kbd __P((struct device *, struct device *));
*/
void wsdisplay_kbdinput __P((struct device *v, keysym_t));
int wsdisplay_switch __P((struct device *, int, int));
void wsdisplay_resetemul __P((struct device *));
void wsdisplay_kbdholdscreen __P((struct device *v, int));
void wsdisplay_set_cons_kbd __P((int (*get)(dev_t),

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsdisplay.c,v 1.14 1999/01/13 16:21:02 drochner Exp $ */
/* $NetBSD: wsdisplay.c,v 1.15 1999/01/14 11:40:58 drochner Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -33,7 +33,7 @@
static const char _copyright[] __attribute__ ((unused)) =
"Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.";
static const char _rcsid[] __attribute__ ((unused)) =
"$NetBSD: wsdisplay.c,v 1.14 1999/01/13 16:21:02 drochner Exp $";
"$NetBSD: wsdisplay.c,v 1.15 1999/01/14 11:40:58 drochner Exp $";
#include <sys/param.h>
#include <sys/conf.h>
@ -700,13 +700,17 @@ wsdisplayclose(dev, flag, mode, p)
(*linesw[tp->t_line].l_close)(tp, flag);
ttyclose(tp);
}
/* XXX RESET EMULATOR? */
if (scr->scr_syncops)
(*scr->scr_syncops->destroy)(scr->scr_synccookie);
if (WSSCREEN_HAS_EMULATOR(scr))
if (WSSCREEN_HAS_EMULATOR(scr)) {
scr->scr_flags &= ~SCR_GRAPHICS;
if (scr->scr_dconf->wsemul->reset != NULL)
(*scr->scr_dconf->wsemul->reset)
(scr->scr_dconf->wsemulcookie, WSEMUL_RESET);
}
#ifdef WSDISPLAY_COMPAT_RAWKBD
if (scr->scr_rawkbd) {
@ -1334,6 +1338,24 @@ wsdisplay_switch(dev, no, waitok)
return (wsdisplay_switch1(sc, waitok));
}
void
wsdisplay_resetemul(dev)
struct device *dev;
{
struct wsdisplay_softc *sc = (struct wsdisplay_softc *)dev;
struct wsscreen *scr;
KASSERT(sc != NULL);
scr = sc->sc_focus;
if (!scr || !WSSCREEN_HAS_EMULATOR(scr))
return;
if (scr->scr_dconf->wsemul->reset != NULL)
(*scr->scr_dconf->wsemul->reset)
(scr->scr_dconf->wsemulcookie, WSEMUL_RESET);
}
/*
* Interface for (external) VT switch / process synchronization code
*/