Reset isearch state on ctrl+c when using Readline 7
This change does not affect Readline versions below 7.
A fix for RL<7 would be to modify readline_state to turn off
ISEARCH and set DONE, but changing these values through the
Perl module does not appear to have visible effect.
--- a/shelldap Wed May 08 20:45:04 2019 +0200
+++ b/shelldap Thu May 16 02:17:04 2019 +0200
@@ -2769,7 +2769,11 @@
sub ctrl_c_handler {
print "\n";
$shell->term->on_new_line;
- $shell->term->replace_line('', 0);
+ $shell->term->kill_text;
+ $shell->term->callback_sigcleanup;
+ $shell->term->free_line_state;
+ $shell->term->cleanup_after_signal;
+ $shell->term->callback_handler_remove;
$shell->term->redisplay;
}
my $sigaction = POSIX::SigAction->new( \&ctrl_c_handler, $sigset, 0);