Skip Menu |

This queue is for tickets about the Devel-REPL CPAN distribution.

Report information
The Basics
Id: 72433
Status: open
Priority: 0/
Queue: Devel-REPL

People
Owner: Nobody in particular
Requestors: WORR [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.003012
Fixed in: (no value)



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
On Tue Nov 15 06:00:16 2011, WORR wrote: Show quoted text
> [ 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.
Since it's been a few years and this was never added, I decided to take a shot at doing it in the repl.rc. Use this if you want to patch around the problem: # fix Term::ReadLine::Gnu to allow $! if ($_REPL->term->ReadLine eq 'Term::ReadLine::Gnu') { $_REPL->term->Attribs->{history_expansion_char} = ''; $_REPL->term->Attribs->{history_subst_char} = ''; }