Kernel support for erase2 character.

Submitted by:	Rui Pedro Mendes Salgueiro <rps@mat.uc.pt>
This commit is contained in:
Jordan K. Hubbard 2000-11-28 20:03:23 +00:00
parent 4660b1416d
commit 7022a92395
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=69322
3 changed files with 16 additions and 5 deletions

View File

@ -459,9 +459,9 @@ ttyinput(c, tp)
* processing takes place.
*/
/*
* erase (^H / ^?)
* erase or erase2 (^H / ^?)
*/
if (CCEQ(cc[VERASE], c)) {
if (CCEQ(cc[VERASE], c) || CCEQ(cc[VERASE2], c) ) {
if (tp->t_rawq.c_cc)
ttyrub(unputc(&tp->t_rawq), tp);
goto endcase;
@ -2010,8 +2010,17 @@ ttyrub(c, tp)
(void)ttyoutput('\\', tp);
}
ttyecho(c, tp);
} else
} else {
ttyecho(tp->t_cc[VERASE], tp);
/*
* This code may be executed not only when an ERASE key
* is pressed, but also when ^U (KILL) or ^W (WERASE) are.
* So, I didn't think it was worthwhile to pass the extra
* information (which would need an extra parameter,
* changing every call) needed to distinguish the ERASE2
* case from the ERASE.
*/
}
--tp->t_rocount;
}

View File

@ -56,8 +56,9 @@
#define VKILL 5 /* ICANON */
#ifndef _POSIX_SOURCE
#define VREPRINT 6 /* ICANON together with IEXTEN */
#define VERASE2 7 /* ICANON */
#endif
/* 7 spare 1 */
/* 7 ex-spare 1 */
#define VINTR 8 /* ISIG */
#define VQUIT 9 /* ISIG */
#define VSUSP 10 /* ISIG */

View File

@ -61,6 +61,7 @@
#define CEOF CTRL('d')
#define CEOL 0xff /* XXX avoid _POSIX_VDISABLE */
#define CERASE 0177
#define CERASE2 CTRL('h')
#define CINTR CTRL('c')
#define CSTATUS CTRL('t')
#define CKILL CTRL('u')
@ -90,7 +91,7 @@
#ifdef TTYDEFCHARS
static cc_t ttydefchars[NCCS] = {
CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
_POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
CERASE2, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE
};
#undef TTYDEFCHARS