reset and redraw on sigcont. From Anon Ymous.

This commit is contained in:
christos 2009-02-19 15:20:22 +00:00
parent c6c3da7776
commit e8bbf84cd0
3 changed files with 18 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: read.c,v 1.45 2009/02/15 21:55:23 christos Exp $ */
/* $NetBSD: read.c,v 1.46 2009/02/19 15:20:22 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: read.c,v 1.45 2009/02/15 21:55:23 christos Exp $");
__RCSID("$NetBSD: read.c,v 1.46 2009/02/19 15:20:22 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@ -294,14 +294,21 @@ read_char(EditLine *el, char *cp)
ssize_t num_read;
int tried = 0;
while ((num_read = read(el->el_infd, cp, 1)) == -1)
again:
el->el_signal->sig_no = 0;
while ((num_read = read(el->el_infd, cp, 1)) == -1) {
if (el->el_signal->sig_no == SIGCONT) {
sig_set(el);
el_set(el, EL_REFRESH);
goto again;
}
if (!tried && read__fixio(el->el_infd, errno) == 0)
tried = 1;
else {
*cp = '\0';
return (-1);
}
}
return (int)num_read;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sig.c,v 1.14 2009/02/18 15:04:40 christos Exp $ */
/* $NetBSD: sig.c,v 1.15 2009/02/19 15:20:22 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)sig.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: sig.c,v 1.14 2009/02/18 15:04:40 christos Exp $");
__RCSID("$NetBSD: sig.c,v 1.15 2009/02/19 15:20:22 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@ -75,6 +75,8 @@ sig_handler(int signo)
(void) sigaddset(&nset, signo);
(void) sigprocmask(SIG_BLOCK, &nset, &oset);
sel->el_signal->sig_no = signo;
switch (signo) {
case SIGCONT:
tty_rawmode(sel);
@ -160,12 +162,12 @@ sig_set(EditLine *el)
struct sigaction osa, nsa;
nsa.sa_handler = sig_handler;
nsa.sa_flags = 0;
sigemptyset(&nsa.sa_mask);
(void) sigprocmask(SIG_BLOCK, &el->el_signal->sig_set, &oset);
for (i = 0; sighdl[i] != -1; i++) {
nsa.sa_flags = SIGINT ? 0 : SA_RESTART;
/* This could happen if we get interrupted */
if (sigaction(sighdl[i], &nsa, &osa) != -1 &&
osa.sa_handler != sig_handler)

View File

@ -1,4 +1,4 @@
/* $NetBSD: sig.h,v 1.7 2009/02/15 21:25:01 christos Exp $ */
/* $NetBSD: sig.h,v 1.8 2009/02/19 15:20:22 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -61,6 +61,7 @@
typedef struct {
struct sigaction sig_action[ALLSIGSNO];
sigset_t sig_set;
volatile sig_atomic_t sig_no;
} *el_signal_t;
protected void sig_end(EditLine*);