Handle tcgetattr(), tcsetattr() and ioctl() by wrapping them in
a retry-loop and restarting them when receiving EINTR.
Should fix problem with sporadic error messages on the console
like this one:
'Failed tcsetattr: Interrupted system call'
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This changeset adds support for:
* rl_prep_terminal(),
* rl_deprep_terminal(), both of which are only wrappers to rl_ttyset().
* rl_getc()
and:
* (*rl_getc_function), defaults to rl_getc()
* (*rl_event_hook)
* (*rl_prep_term_function), defaults to rl_prep_terminal()
* (*rl_deprep_term_function), defaults to rl_deprep_terminal()
For further details, see http://www.cs.unc.edu/~tell/dist/magic-readline.README
Differences from Steve's commit include: signal safety in rl_getc(), restart
read() on EINTR, and make sure to support "int meta_flag" to rl_prep_terminal()
which is the GNU syntax. To that end I reused the inverse of rl_meta_chars.
The ordering of alternative rl_ttyset() implementations is important.
We have chosen to place the most common, most portable, code first
and then in lesser order. Ending with the sgtty.h based code, which
I cannot test on GNU/Linux. Will test on OpenBSD later.
Also added Emacs indentation style to make it easier to follow the
original style of Mr Turner and Salz.
Remove all old $Id:$ and similar constructs, they don't provide any
additional benefit anymore.
Add configure options for toggling terminal bell and toying with
SIGSTOP using Ctrl-Z. Rename config option for ANSI keys to get
a consistent namespace.
Also did some work on ANSI-fication of function definitions, lot's
of that was still lingering around.
to work better on embedded targets running off the initial console.
Also, first merge of patches from Debian. This part holds all of the
sysunix.c changes and some 8-bit patches and SIGSTP patches in the
editline.c file.