Subject: | Use of Term::ReadLine::Gnu breaks use of $! variable |
[ will on buttons ] ( devel-repl ) % re.pl
re.pl(Devel::REPL::Plugin::Packages::DefaultScratchpad):001:0> print $!;
!;: event not found
re.pl(Devel::REPL::Plugin::Packages::DefaultScratchpad):002:0>
My patch removes the ! search if Gnu Readline is used.
Subject: | 0001-Fixed-bug-where-Gnu-readline-lib-prevents-use-of.patch |
From 08960fa2e6fd1d9466614817cb14203cac34af48 Mon Sep 17 00:00:00 2001
From: William Orr <will@worrbase.com>
Date: Tue, 15 Nov 2011 00:57:14 -0500
Subject: [PATCH] Fixed bug where Gnu readline lib prevents use of $!
---
lib/Devel/REPL.pm | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/Devel/REPL.pm b/lib/Devel/REPL.pm
index a46d787..7d121e0 100644
--- a/lib/Devel/REPL.pm
+++ b/lib/Devel/REPL.pm
@@ -33,6 +33,12 @@ has 'exit_repl' => (
sub run {
my ($self) = @_;
+
+ if ($self->term->ReadLine eq 'Term::ReadLine::Gnu') {
+ $self->term->Attribs->{history_expansion_char} = '';
+ $self->term->Attribs->{history_subst_char} = '';
+ }
+
while ($self->run_once_safely) {
# keep looping unless we want to exit REPL
last if $self->exit_repl;
--
1.7.7.3