search for: rl_cleanup_after_sign

Displaying 3 results from an estimated 3 matches for "rl_cleanup_after_sign".

2016 Mar 08
1
[PATCH] fish: reset the console on ^Z RHBZ#1213844
Patch registers SIGTSTP hook where it sends reset terminal color control sequence using write and fsync. Handler is installed only if signal is not being ignored. Patch uses rl_free_line_state and rl_cleanup_after_signal to unhook readline from terminal, then it calls original TSTP handler using approach in URL below and again hooks readline using rl_reset_after_signal. Handling is based on code from: http://man7.org/tlpi/code/online/dist/pgsjc/handling_SIGTSTP.c.html This approach seems to mostly work. User is...
2016 Feb 16
2
[PATCH] fish: reset the console on ^Z RHBZ#1213844
Patch registers SIGTSTP hook where it sends reset terminal color control sequence. Maros Zatko (1): fish: reset the console on ^Z RHBZ#1213844 fish/fish.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) -- 2.5.0
2016 Feb 16
0
[PATCH] fish: reset the console on ^Z RHBZ#1213844
...rol_z); +} + +/* + * Restore the TSTP handler. + */ +static void +restore_stophandler (void) +{ + signal (SIGTSTP, otstpfn); +} + +static void +user_control_z (int sig) +{ + sigset_t oset, set; + +#ifdef HAVE_LIBREADLINE + /* Cleanup readline, unhook from terminal */ + rl_free_line_state (); + rl_cleanup_after_signal (); +#endif + + /* Reset terminal color */ +#define RESETCOLOR "\033[0m" + printf (RESETCOLOR); + fflush (stdout); + + /* Unblock SIGTSTP. */ + sigemptyset (&set); + sigaddset (&set, SIGTSTP); + sigprocmask (SIG_UNBLOCK, &set, NULL); + + restore_stophandler (); + +...