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>
o Bump minor version for release
o Update maintainer email address
o Change to tar.xz for archive distribution
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The two functions el_bind_key() and el_bind_key_in_metamap() should
not print status message on stderr, but rather return the status of
the key binding operation.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
When adding support for rl_reset_termial() the tty_info() code was also
refactored. This however led to the introduction of a bug that caused
tty_cols to be set to zero. This in turn caused c_possible() to fail
with SIGFPE in el_print_columns().
Regression was introduced in 1c89c9886c
This changeset refactors el_bind_key_in_metamap() into two functions,
adding el_bind_key(), to provide the ability for the user to bind keys
in both the regular and the meta-key maps.
Several useful, but previously internal, functions have been made global to
facilitate the example code mentioned above. These are likely useful to the
user of this library as well:
el_print_columns() - Display words in columns across a tty_cols wide screen.
el_ring_bell() - Can be used as default key binding function.
el_find_word() - Returns a copy of the word at rl_point.
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.
After the revert of function pointers for rl_complete() and rl_list_possib(),
introduced in v0.2.2, we need to build complete.c for all configurations. The
user should use the rl_set_*_func() calls merged from the Heimdal project's
readline fork.
1. Simplify code in reposition()
2. Add tty_push() for commonly used operation, reduce code duplication.
3. Fix left() so that it treats 8-bit chars as one when not in meta-mode.
4. Replace isalnum() with homegrown implementation that understands 8-bit
and control chars.
5. Fix ceol() before introducing ANSI "kill-to-end-of-line" escape code.
This actually seems to work, previously I erronesouly used an UTF-8
terminal for testing. Which of course broke the test on an ISO-8859-1
[only] terminal.