Skip Menu |

This queue is for tickets about the IO-Prompter CPAN distribution.

Report information
The Basics
Id: 82726
Status: open
Priority: 0/
Queue: IO-Prompter

People
Owner: Nobody in particular
Requestors: gottreu [...] gmail.com
Cc:
AdminCc:

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



Subject: Patch to disable input history
Motivated by this stackoverflow question (http://stackoverflow.com/questions/14341038/ioprompter-is-it-possible- to-disable-history), here's a patch that uses 'NONE' as the name of a special history set that does not record the input into the history.
Subject: no-history.patch
--- IO-Prompter-0.004002/lib/IO/Prompter.pm 2012-09-24 04:39:24.000000000 -0500 +++ change/lib/IO/Prompter.pm 2013-01-15 13:03:03.160164225 -0600 @@ -239,7 +239,7 @@ } # "Those who remember history are enabled to repeat it"... - if (defined $input) { + if (defined $input and $opt_ref->{-history} ne "NONE") { my $history_set = $history_cache{ $opt_ref->{-history} } //= [] ; @{ $history_set } = ($input, grep { $_ ne $input } @{ $history_set }); } @@ -2342,7 +2342,7 @@ The C<prompt()> subroutine also tracks previous input and allows you to complete with that instead. No special option is required, as the -feature is always enabled. +feature is enabled by default. At the start of a prompted input, the user can cycle backwards through previous inputs by pressing C<< <CTRL-R> >> (this can be changed @@ -2428,6 +2428,8 @@ $address .= prompt "Address (line $n):", -hADDR; } +If you specify C<'NONE'> as the history set then the input is not +recorded in the history. This is useful when inputting passwords. =head4 Configuring the autocompletion interaction
Subject: Re: [rt.cpan.org #82726] Patch to disable input history
Date: Wed, 16 Jan 2013 16:27:41 +1100
To: bug-IO-Prompter [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Many thanks, Brian! An extremely useful patch. I've applied it and uploaded. Damian