Skip Menu |

This queue is for tickets about the Term-ReadLine-Perl CPAN distribution.

Report information
The Basics
Id: 5964
Status: open
Priority: 0/
Queue: Term-ReadLine-Perl

People
Owner: Nobody in particular
Requestors: slaven [...] rezic.de
Cc:
AdminCc:

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



Subject: Term::ReadLine::Perl should not use $ENV{EDITOR}
The subject says it all. Term::ReadLine::Perl uses the value of $ENV{EDITOR} to determine which editing mode (emacs or vi) should be used. This is contrary to the original GNU readline, where the editing mode is by default "emacs", regardless of the EDITOR environment variable. The attached patch fixes this problem. Additionaly, it is possible now to use PERL_RL="Perl mode=vi" to set the vi editing mode via environment variable. Regards, Slaven
# # # To apply this patch: # STEP 1: Chdir to the source directory. # STEP 2: Run the 'applypatch' program with this patch file as input. # # If you do not have 'applypatch', it is part of the 'makepatch' package # that you can fetch from the Comprehensive Perl Archive Network: # http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz # In the above URL, 'x' should be 2 or higher. # # To apply this patch without the use of 'applypatch': # STEP 1: Chdir to the source directory. # STEP 2: Run the 'patch' program with this file as input. # #### End of Preamble #### #### Patch data follows #### diff -up '/home/slavenr/.cpan/build/Term-ReadLine-Perl-1.0203/ReadLine/readline.pm' '/home/slavenr/tmp/Term-ReadLine-Perl-1.0203/ReadLine/readline.pm' Index: ./ReadLine/readline.pm --- ./ReadLine/readline.pm Sat May 25 03:21:12 2002 +++ ./ReadLine/readline.pm Wed Apr 7 15:00:27 2004 @@ -16,10 +16,11 @@ ## Call rl_set to set mode variables yourself, as in ## &readline'rl_set('TcshCompleteMode', 'On'); ## -## If $ENV{EDITOR} is a string containing the substring 'vi', we start in vi -## input mode; otherwise start in emacs mode. To override this behavior, do +## By default we start in emacs mode, regardless of the value of +## $ENV{EDITOR}. To override this behavior, do ## &readline::rl_set('EditingMode', 'vi'); ## or &readline::rl_set('EditingMode', 'emacs'); +## or add " mode=vi" to the PERL_RL environment variable. ## ## Call rl_basic_commands to set your own command completion, as in ## &readline'rl_basic_commands('print', 'list', 'quit', 'run', 'status'); @@ -71,7 +72,7 @@ $VERSION = $VERSION = '1.0203'; ## Changed subs: ## ## * preinit(): Initialize new keymaps and other data structures. -## Use $ENV{EDITOR} to set startup mode. +## Use $ENV{PERL_RL} to set startup mode. ## ## * init(): Sets the global *KeyMap, since &F_ReReadInitFile ## may have changed the key map. @@ -1010,8 +1011,10 @@ sub preinit ord('E') => q{.\s*\S*(?=\S)|.?\s*(?=\s$)}, }; - my $default_mode = - (defined $ENV{EDITOR} and $ENV{EDITOR} =~ /vi/) ? 'vi' : 'emacs'; + my $default_mode = 'emacs'; + if (defined $ENV{PERL_RL} && $ENV{PERL_RL} =~ / mode=vi/) { + $default_mode = 'vi'; + } *KeyMap = $var_EditingMode = $var_EditingMode{$default_mode}; diff -up '/home/slavenr/.cpan/build/Term-ReadLine-Perl-1.0203/test.pl' '/home/slavenr/tmp/Term-ReadLine-Perl-1.0203/test.pl' Index: ./test.pl --- ./test.pl Sat Mar 30 23:34:00 2002 +++ ./test.pl Wed Apr 7 15:00:21 2004 @@ -1,6 +1,6 @@ # Give an argument to use stdin, stdout instead of console # If argument starts with /dev, use it as console -BEGIN{ $ENV{PERL_RL} = 'Perl' }; # Do not test TR::Gnu ! +BEGIN{ $ENV{PERL_RL} =~ s/^\w*/Perl/; }; # Do not test TR::Gnu, but preserve any additional options use Term::ReadLine; use Carp; #### End of Patch data #### #### ApplyPatch data follows #### # Data version : 1.0 # Date generated : Wed Apr 7 15:04:05 2004 # Generated by : makepatch 2.00_12* # Recurse directories : Yes # Excluded files : (\A|/).*\~\Z # (\A|/).*\.a\Z # (\A|/).*\.bak\Z # (\A|/).*\.BAK\Z # (\A|/).*\.elc\Z # (\A|/).*\.exe\Z # (\A|/).*\.gz\Z # (\A|/).*\.ln\Z # (\A|/).*\.o\Z # (\A|/).*\.obj\Z # (\A|/).*\.olb\Z # (\A|/).*\.old\Z # (\A|/).*\.orig\Z # (\A|/).*\.rej\Z # (\A|/).*\.so\Z # (\A|/).*\.Z\Z # (\A|/)\.del\-.*\Z # (\A|/)\.make\.state\Z # (\A|/)\.nse_depinfo\Z # (\A|/)core\Z # (\A|/)tags\Z # (\A|/)TAGS\Z # p 'ReadLine/readline.pm' 116579 1081342827 0100664 # p 'test.pl' 1027 1081342821 0100444 #### End of ApplyPatch data #### #### End of Patch kit [created: Wed Apr 7 15:04:05 2004] #### #### Patch checksum: 87 3647 55388 #### #### Checksum: 105 4271 41400 ####
Date: Wed, 7 Apr 2004 11:05:47 -0700
From: Ilya Zakharevich <ilya [...] Math.Berkeley.EDU>
To: Slaven_Rezic via RT <bug-Term-ReadLine-Perl [...] rt.cpan.org>
CC: "AdminCc of cpan Ticket #5964": ;
Subject: Re: [cpan #5964] Term::ReadLine::Perl should not use $ENV{EDITOR}
RT-Send-Cc:
On Wed, Apr 07, 2004 at 09:07:17AM -0400, Slaven_Rezic via RT wrote: Show quoted text
> > This message about Term-ReadLine-Perl was sent to you by SREZIC <SREZIC@cpan.org> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=5964 >
No it cannot. Yours, Ilya
Date: Wed, 7 Apr 2004 11:45:31 -0700
From: Ilya Zakharevich <ilya [...] Math.Berkeley.EDU>
To: Slaven_Rezic via RT <bug-Term-ReadLine-Perl [...] rt.cpan.org>
CC: "AdminCc of cpan Ticket #5964": ;
Subject: Re: [cpan #5964] Term::ReadLine::Perl should not use $ENV{EDITOR}
RT-Send-Cc:
On Wed, Apr 07, 2004 at 09:07:17AM -0400, Slaven_Rezic via RT wrote: Show quoted text
> > This message about Term-ReadLine-Perl was sent to you by SREZIC <SREZIC@cpan.org> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=5964 >
Well, maybe it has, but it requires cookies... Show quoted text
> The subject says it all. Term::ReadLine::Perl uses the value of $ENV{EDITOR} > to determine which editing mode (emacs or vi) should be used. This is > contrary to the original GNU readline, where the editing mode is by > default "emacs", regardless of the EDITOR environment variable. > > The attached patch fixes this problem. Additionaly, it is possible now to use > PERL_RL="Perl mode=vi" to set the vi editing mode via environment variable.
Do you think this is better than PERL_RL_EDITOR=vi or PERL_RL_EDITOR=- # Inherit from $EDITOR ? Ilya
From: ntyni [...] iki.fi
On Wed Apr 07 14:46:12 2004, ilya@Math.Berkeley.EDU wrote: Show quoted text
> On Wed, Apr 07, 2004 at 09:07:17AM -0400, Slaven_Rezic via RT wrote:
Show quoted text
> > The subject says it all. Term::ReadLine::Perl uses the value of
> $ENV{EDITOR}
> > to determine which editing mode (emacs or vi) should be used. This
> is
> > contrary to the original GNU readline, where the editing mode is by > > default "emacs", regardless of the EDITOR environment variable. > > > > The attached patch fixes this problem. Additionaly, it is possible
> now to use
> > PERL_RL="Perl mode=vi" to set the vi editing mode via environment
> variable.
Hi, I just wanted to ask about the status of this issue. Do you plan to change it? The fix seems easy; it's just a matter of taste which of the suggested replacements is the best. (We still have an open bug report on this in Debian as well, http://bugs.debian.org/145383 , and FWIW, I agree that EDITOR is the wrong variable for this myself.) Regards, -- Niko Tyni (on behalf of the Debian Perl Team) ntyni@iki.fi
From: rjbs [...] cpan.org
On Wed Apr 07 09:07:16 2004, SREZIC wrote: Show quoted text
> The subject says it all. Term::ReadLine::Perl uses the value of > $ENV{EDITOR} > to determine which editing mode (emacs or vi) should be used. This is > contrary to the original GNU readline, where the editing mode is by > default "emacs", regardless of the EDITOR environment variable.
AUGH! I have suffered for months with this problem, and with some bizarre ramifications, like "the perl debugger will not display the first line of output properly if EDITOR is vi" I never realized this was the issue until I was led by chance to try the debugger with each login option removed one by one. I finally realized that Term::ReadLine::Perl was doing this horrible, horrible thing. I don't care what PL_READLINE_EDITOR, or whatever, does. I just want EDITOR alone NOT to make ReadLine act stupidly. PLEASE!
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #5964] Term::ReadLine::Perl should not use $ENV{EDITOR}
Date: Wed, 26 Apr 2006 17:04:56 -0700
To: Guest via RT <bug-Term-ReadLine-Perl [...] rt.cpan.org>
From: Ilya Zakharevich <nospam-abuse [...] ilyaz.org>
On Wed, Apr 26, 2006 at 08:36:48AM -0400, Guest via RT wrote: Show quoted text
> I never realized this was the issue until I was led by chance to try the debugger with each login > option removed one by one. I finally realized that Term::ReadLine::Perl was doing this horrible, > horrible thing. I don't care what PL_READLINE_EDITOR, or whatever, does. I just want EDITOR > alone NOT to make ReadLine act stupidly. PLEASE!
a) There is no reason to yell. b) I have no idea what you are talking about. There is no EDITOR access. Hope this helps, Ilya
On Wed Apr 26 20:05:54 2006, nospam-abuse@ilyaz.org wrote: Show quoted text
> On Wed, Apr 26, 2006 at 08:36:48AM -0400, Guest via RT wrote: >
> > I never realized this was the issue until I was led by chance to try
> the debugger with each login
> > option removed one by one. I finally realized that
> Term::ReadLine::Perl was doing this horrible,
> > horrible thing. I don't care what PL_READLINE_EDITOR, or whatever,
> does. I just want EDITOR
> > alone NOT to make ReadLine act stupidly. PLEASE!
> > a) There is no reason to yell. > b) I have no idea what you are talking about. There is no EDITOR > access. > > Hope this helps, > Ilya
There was, but in 1.03 it's definitely gone. From Term/ReadLine/readline.pm: ## - Changes from Slaven Rezic (slaven@rezic.de): ## * reverted the usage of $ENV{EDITOR} to set startup mode ## only ~/.inputrc or an explicit call to rl_set should ## be used to set startup mode I think this ticket may be closed. Regards, Slaven
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #5964] Term::ReadLine::Perl should not use $ENV{EDITOR}
Date: Thu, 27 Apr 2006 01:59:51 -0700
To: Slaven_Rezic via RT <bug-Term-ReadLine-Perl [...] rt.cpan.org>
From: Ilya Zakharevich <nospam-abuse [...] ilyaz.org>
On Thu, Apr 27, 2006 at 04:54:54AM -0400, Slaven_Rezic via RT wrote: Show quoted text
> I think this ticket may be closed.
There is no "tickets". It is a bug in RT that it pretends there are. This is just an email portal, nothing more. Hope this helps, Ilya