fixed ^K handling R_1_30
authordjk <djk>
Tue, 29 Jun 1999 10:40:13 +0000 (10:40 +0000)
committerdjk <djk>
Tue, 29 Jun 1999 10:40:13 +0000 (10:40 +0000)
perl/console.pl

index 35924e4c08a2a02f1f2be26dcab53a28d3be6769..977285dad1e1db43d60f215a7ee7d67c38c3c906 100755 (executable)
@@ -216,6 +216,8 @@ sub rec_stdin
                        }
                } elsif ($r eq KEY_HOME || $r eq "\001") {
                        $pos = 0;
+               } elsif ($r eq KEY_END || $r eq "\005") {
+                       $pos = $lth;
                } elsif ($r eq KEY_BACKSPACE || $r eq "\010") {
                        if ($pos > 0) {
                                my $a = substr($inbuf, 0, $pos-1);
@@ -253,8 +255,8 @@ sub rec_stdin
                        $scr->touchwin();
                        $scr->refresh();
                } elsif ($r eq "\013") {
-                       $inbuf = "";
-                       $pos = $lth = 0;
+                       $inbuf = substr($inbuf, 0, $pos);
+                       $lth = length $inbuf;
                } else {
                        beep();
                }