And then rebuild and install a new kernel:
KK=`sysctl -n kern.osversion | cut -d# -f1`
cd /usr/src/sys/arch/`machine`/compile/$KK
make obj
make config
make
make install
/*
- * Process input of a single character received on a tty.
+ * Process input of a single character received on a tty. Returns 0 for
+ * simple operations, 1 for costly ones (ptcwrite needs to know).
*/
int
ttyinput(int c, struct tty *tp)
{
int iflag, lflag;
u_char *cc;
- int i, error;
+ int i, error, ret = 0;
int s;
enqueue_randomness(tp->t_dev << 8 | c);
@@ -342,7 +343,7 @@ parmrk: (void)putc(0377 | TTY_QUOTE,
ttyflush(tp, FWRITE);
ttyecho(c, tp);
if (tp->t_rawq.c_cc + tp->t_canq.c_cc)
- ttyretype(tp);
+ ret = ttyretype(tp);
SET(tp->t_lflag, FLUSHO);
}
goto startoutput;
@@ -443,7 +444,7 @@ parmrk: (void)putc(0377 | TTY_QUOTE,
*/
if (CCEQ(cc[VERASE], c)) {
if (tp->t_rawq.c_cc)
- ttyrub(unputc(&tp->t_rawq), tp);
+ ret = ttyrub(unputc(&tp->t_rawq), tp);
goto endcase;
}
/*
@@ -452,10 +453,11 @@ parmrk: (void)putc(0377 | TTY_QUOTE,
if (CCEQ(cc[VKILL], c)) {
if (ISSET(lflag, ECHOKE) &&
tp->t_rawq.c_cc == tp->t_rocount &&
- !ISSET(lflag, ECHOPRT))
+ !ISSET(lflag, ECHOPRT)) {
while (tp->t_rawq.c_cc)
- ttyrub(unputc(&tp->t_rawq), tp);
- else {
+ if (ttyrub(unputc(&tp->t_rawq), tp))
+ ret = 1;
+ } else {
ttyecho(c, tp);
if (ISSET(lflag, ECHOK) ||
ISSET(lflag, ECHOKE))
@@ -477,14 +479,16 @@ parmrk: (void)putc(0377 | TTY_QUOTE,
* erase whitespace
*/
while ((c = unputc(&tp->t_rawq)) == ' ' || c == '\t')
- ttyrub(c, tp);
+ if (ttyrub(c, tp))
+ ret = 1;
if (c == -1)
goto endcase;
/*
* erase last char of word and remember the
* next chars type (for ALTWERASE)
*/
- ttyrub(c, tp);
+ if (ttyrub(c, tp))
+ ret = 1;
c = unputc(&tp->t_rawq);
if (c == -1)
goto endcase;
@@ -497,7 +501,8 @@ parmrk: (void)putc(0377 | TTY_QUOTE,
* erase rest of word
*/
do {
- ttyrub(c, tp);
+ if (ttyrub(c, tp))
+ ret = 1;
c = unputc(&tp->t_rawq);
if (c == -1)
goto endcase;
@@ -510,7 +515,7 @@ parmrk: (void)putc(0377 | TTY_QUOTE,
* reprint line (^R)
*/
if (CCEQ(cc[VREPRINT], c) && ISSET(lflag, IEXTEN)) {
- ttyretype(tp);
+ ret = ttyretype(tp);
goto endcase;
}
/*
@@ -577,12 +582,13 @@ endcase:
*/
if (ISSET(tp->t_state, TS_TTSTOP) &&
!ISSET(iflag, IXANY) && cc[VSTART] != cc[VSTOP])
- return (0);
+ return (ret);
restartoutput:
CLR(tp->t_lflag, FLUSHO);
CLR(tp->t_state, TS_TTSTOP);
startoutput:
- return (ttstart(tp));
+ ttstart(tp);
+ return (ret);
}
/*
@@ -1882,7 +1888,7 @@ ovhiwat:
* Rubout one character from the rawq of tp
* as cleanly as possible.
*/
-void
+int
ttyrub(int c, struct tty *tp)
{
u_char *cp;
@@ -1890,15 +1896,14 @@ ttyrub(int c, struct tty *tp)
int tabc, s;