From: djk Date: Tue, 29 Jun 1999 10:40:13 +0000 (+0000) Subject: fixed ^K handling X-Git-Tag: R_1_30 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=49b58d78173f71f0cf2662d7ed853a46c994b197;p=spider.git fixed ^K handling --- diff --git a/perl/console.pl b/perl/console.pl index 35924e4c..977285da 100755 --- a/perl/console.pl +++ b/perl/console.pl @@ -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(); }