Skip Menu |

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 38052
Status: resolved
Priority: 0/
Queue: CPAN

People
Owner: Nobody in particular
Requestors: rodrigo.marchant [...] lan.com
Cc:
AdminCc:

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



Subject: History size is not being respected (histsize option)
Date: Wed, 30 Jul 2008 16:15:40 -0400
To: bug-CPAN [...] rt.cpan.org
From: "Marchant, Rodrigo" <rodrigo.marchant [...] lan.com>
In distribution ANDK/CPAN-1.9205.tar.gz perl version: 5.8.5 OS: Linux xxx.yyy.zzz 2.6.9-67.0.20.ELsmp #1 SMP Wed Jun 18 12:40:47 EDT 2008 i686 i686 i386 GNU/Linux CPAN's shell is not respecting the "histsize". You can test this bug this way: set "histsize" to a number bigger than 100 Enter more than 100 commands exit check the number of lines of the history file: it will be 100 That happens because Term::ReadLine->readline() function is cutting the history size to the size of the readline::rl_MaxHistorySize, that has a default of 100. This is in line 589 of Term/ReadLine/readline.pm (version 1.0302 of ILYAZ/modules/Term-ReadLine-Perl-1.0302.tar.gz) The patch would be to setup the attribute MaxHistorySize of $CPAN::term to the value of CPAN's "histsize": --- CPAN3.pm 2007-11-11 11:45:55.000000000 +0000 +++ CPAN.pm 2008-07-30 19:52:24.000000000 +0000 @@ -1446,6 +1446,8 @@ #-> sub CPAN::readhist sub readhist { my($self,$term,$histfile) = @_; + my $histsize = $CPAN::Config->{'histsize'} || 100; + $term->Attribs->{'MaxHistorySize'} = $histsize if (defined($term->Attribs->{'MaxHistorySize'})); my($fh) = FileHandle->new; open $fh, "<$histfile" or last; local $/ = "\n"; That fixed the behaviour in my CPAN's shell, now I can have history files with more than 100 commands. Greetings, Rodrigo Marchant
Subject: Re: [rt.cpan.org #38052] History size is not being respected (histsize option)
Date: Thu, 31 Jul 2008 01:55:06 +0200
To: bug-CPAN [...] rt.cpan.org
From: andreas.koenig.7os6VVqR [...] franz.ak.mind.de (Andreas J. Koenig)
Show quoted text
>>>>> On Wed, 30 Jul 2008 16:16:55 -0400, "Marchant, Rodrigo via RT" <bug-CPAN@rt.cpan.org> said:
Show quoted text
> --- CPAN3.pm 2007-11-11 11:45:55.000000000 +0000 > +++ CPAN.pm 2008-07-30 19:52:24.000000000 +0000
Thank you! Applied as rev 3281 to the repository. -- andreas
Thanks, fixed in release 1.93