From: djk Date: Tue, 29 Jun 1999 10:40:13 +0000 (+0000) Subject: fixed ^K handling X-Git-Tag: R_1_30^0 X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=commitdiff_plain;h=2f4355fb63f336cce61887b189d5556faf1734d7 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(); }