summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>2000-11-28 20:03:23 +0000
committerjkh <jkh@FreeBSD.org>2000-11-28 20:03:23 +0000
commit8c1ad5939936de051229123b210d7f9e70c83d14 (patch)
treea306144605803b8142900d9f08e18d6cf73b2958
parent644ee6003f020d2d286f7b4b37bc447c94d00f32 (diff)
downloadFreeBSD-src-8c1ad5939936de051229123b210d7f9e70c83d14.zip
FreeBSD-src-8c1ad5939936de051229123b210d7f9e70c83d14.tar.gz
Kernel support for erase2 character.
Submitted by: Rui Pedro Mendes Salgueiro <rps@mat.uc.pt>
-rw-r--r--sys/kern/tty.c15
-rw-r--r--sys/sys/termios.h3
-rw-r--r--sys/sys/ttydefaults.h3
3 files changed, 16 insertions, 5 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 87fb980..1117708 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -459,9 +459,9 @@ parmrk:
* 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;
}
diff --git a/sys/sys/termios.h b/sys/sys/termios.h
index 933a059..6111fc3 100644
--- a/sys/sys/termios.h
+++ b/sys/sys/termios.h
@@ -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 */
diff --git a/sys/sys/ttydefaults.h b/sys/sys/ttydefaults.h
index 6d23e3b..70f8712 100644
--- a/sys/sys/ttydefaults.h
+++ b/sys/sys/ttydefaults.h
@@ -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
OpenPOWER on IntegriCloud