Add support for disabling default SIGINT and EOF behavior.

This patch adds support for `--disable-eof` and `--disable-sigint` to
the Editline configure script.  With either of these two switches the
`tty_special()` function bypasses the special TTY checks making it
possible to bind Ctrl-C and Ctrl-D to custom callbacks.  This can be
useful if you want to emulate a Cisco style CLI rather than traditional
UNIX.

The user can of course also redefine the VINTR and VEOF special terminal
control characters, but these configure script switches may be easier to
use for some.

Also, the CLI example has been updated to bind Ctrl-D, Ctrl-C and Ctrl-Z
for testing purposes.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2015-04-06 14:45:07 +02:00
parent a2bc89db64
commit 6a8556733a
5 changed files with 65 additions and 2 deletions

View File

@@ -12,6 +12,12 @@
/* Define to enable the default completion handler. */
#undef CONFIG_DEFAULT_COMPLETE
/* Define to enable EOF (Ctrl-C) key. */
#undef CONFIG_EOF
/* Define to enable SIGINT (Ctrl-C) key. */
#undef CONFIG_SIGINT
/* Define to enable SIGSTOP (Ctrl-Z) key. */
#undef CONFIG_SIGSTOP