Skip Menu |

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

Report information
The Basics
Id: 20638
Status: new
Priority: 0/
Queue: IO-Prompt

People
Owner: Nobody in particular
Requestors: peter [...] stuifzand.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: v0.99.4
Fixed in: v0.99.4



Subject: Backspace deletes prompt
When using backspace to delete the input, the prompt also gets deleted. There is a strange pattern, where only the second backspace will delete a character. I have attached a patch that solves the problem. This is my first patch, so I hope I did it right.
Subject: io-prompt.patch
--- Prompt.pm 2006-02-17 05:59:21.000000000 +0100 +++ Prompt-new.pm 2006-07-24 11:11:10.000000000 +0200 @@ -410,9 +410,11 @@ ReadMode 'restore', $IN; exit; } - elsif ($next eq $cntl{ERASE} and length $input) { - substr($input, -1) = ""; - print {$OUT} "\b \b"; + elsif ($next eq $cntl{ERASE}) { + if (length $input) { + substr($input, -1) = ""; + print {$OUT} "\b \b"; + } next; } elsif ($next eq $cntl{EOF}) {