From 2f4355fb63f336cce61887b189d5556faf1734d7 Mon Sep 17 00:00:00 2001 From: djk Date: Tue, 29 Jun 1999 10:40:13 +0000 Subject: [PATCH] fixed ^K handling --- perl/console.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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(); } -- 2.43.0