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

Report information
The Basics
Id:
30668
Status:
open
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
kbrint [...] rufus.net
Cc:
AdminCc:

BugTracker
Severity:
Normal
Broken in:
v0.99.4
Fixed in:
(no value)



Subject: IO::Prompt backspace deletes too much (or not enough)
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 748
When get_input receives an ERASE character on empty input, it should abort the processing earlier. Also, when (length $echo != 1), the backspace erasure doesn't get everything. It can be fixed by changing this: elsif ($next eq $cntl{ERASE} and length $input) { substr($input, -1) = ""; print {$OUT} "\b \b"; next; } To this: elsif ($next eq $cntl{ERASE}) { next unless length $input; substr($input, -1) = ""; print {$OUT} map { $_ x length($echo) } "\b", ' ', "\b"; next; } I've been using this script to verify: while (prompt '-e', '*%', "try backspace: ") { print "you said: $_\n"; } Hope this helps! kevin brintnall
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-4108-1242102638-38.30668-0-0@rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 68
I can confirm this issue. (Thanks, the patch totally works for me.)
MIME-Version: 1.0
X-Spam-Status: No, hits=0.0 required=8.0 tests=DK_SIGNED,SPF_PASS
In-Reply-To: <rt-3.6.HEAD-27656-1194874458-1022.30668-4-0@rt.cpan.org>
References: <RT-Ticket-30668@rt.cpan.org> <rt-3.6.HEAD-27656-1194874458-1022.30668-4-0@rt.cpan.org>
Message-ID: <832f158a0905112149ue6bcfbr831e4c9d23ab2869@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 4E0DE63C585 for <bug-IO-Prompt@rt.cpan.org>; Tue, 12 May 2009 00:49:43 -0400 (EDT)
Received: (qmail 23771 invoked by uid 103); 12 May 2009 04:49:43 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 12 May 2009 04:49:43 -0000
Received: from mail-qy0-f129.google.com (HELO mail-qy0-f129.google.com) (209.85.221.129) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Mon, 11 May 2009 21:49:37 -0700
Received: by qyk35 with SMTP id 35so3178472qyk.33 for <bug-IO-Prompt@rt.cpan.org>; Mon, 11 May 2009 21:49:34 -0700 (PDT)
Received: by 10.220.76.207 with SMTP id d15mr12113370vck.31.1242103774166; Mon, 11 May 2009 21:49:34 -0700 (PDT)
Delivered-To: cpan-bug+IO-Prompt@diesel.bestpractical.com
Subject: Re: [rt.cpan.org #30668] IO::Prompt backspace deletes too much (or not enough)
Domainkey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; b=VNqxkWKzko55Ewe2OTF9NhYPnUCNmPHdri3w2YMdro13vMQ/8gLYDK8gKL3avvjaq8 j/URGvm/kWJuw1NI97gu1JMDwB482EbrVueCikgJ220lHNll1YfxTngYU6kMQy+Brcvw fIEPPTmS/BpBQMxNPvozBuES8k5nG9cTR3jG8=
Return-Path: <thoughtstream@gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type:content-transfer-encoding; bh=6f1YgLWhog7s6YGSCL6shUBml5LbP56X5eN8tYNJS/U=; b=pZWn687gXaNZeB59iQd7ZjXVW1itJ08hcsPWhy1trdnSrGNJhtaVCVzz26/+weMaob eIb9+6JIwvTlihjE5ilijR80EOms5jeIJ/Q6NWngnLbpP8gFQvHPT2HlcVs+7NCZSrM2 0utQwlaut28GjyBI81x7KBSAcC8oVVaBZ+Bwk=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-IO-Prompt@rt.cpan.org
X-Google-Sender-Auth: 769146a099cbdf35
Date: Tue, 12 May 2009 14:49:14 +1000
Sender: thoughtstream@gmail.com
X-Spam-Level: *
To: bug-IO-Prompt@rt.cpan.org
Content-Transfer-Encoding: quoted-printable
From: Damian Conway <damian@conway.org>
RT-Message-ID: <rt-3.6.HEAD-4108-1242103795-1608.30668-0-0@rt.cpan.org>
Content-Length: 253
Show quoted text
> When get_input receives an ERASE character on empty input, it should abort the processing > earlier.  Also, when (length $echo != 1), the backspace erasure doesn't get everything.
Thanks, Kevin. I've applied your patch for the next release. Damian


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.