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}) {