X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fconsole.pl;h=916f3f7501a73c632d7b78a833e03460e6255fdd;hb=93292dcd622b1505d2cbab334277c89e7c8afd27;hp=bc3ca0d67bcb41163bd539e953e5f469daef960b;hpb=e4af773643fca2794a381bf4b44075bcd193a437;p=spider.git diff --git a/perl/console.pl b/perl/console.pl index bc3ca0d6..916f3f75 100755 --- a/perl/console.pl +++ b/perl/console.pl @@ -10,7 +10,7 @@ # # Copyright (c) 1999 Dirk Koopman G1TLH # -# $Id$ +# # require 5.004; @@ -34,6 +34,7 @@ use DXDebug; use IO::File; use Time::HiRes qw(gettimeofday tv_interval); use Curses 1.06; +use Text::Wrap; use Console; @@ -229,8 +230,13 @@ sub addtotop if ($inbuf =~ s/\x07+$//) { beep(); } - push @shistory, $inbuf; - shift @shistory if @shistory > $maxshist; + if (length $inbuf > $cols) { + $Text::Wrap::Columns = $cols; + push @shistory, wrap('',"\t", $inbuf); + } else { + push @shistory, $inbuf; + } + shift @shistory while @shistory > $maxshist; } show_screen(); } @@ -334,7 +340,7 @@ sub rec_stdin } elsif ($r eq KEY_PPAGE || $r eq "\032") { if ($spos > 0) { my ($i, $l); - for ($i = 0; $i <= $pagel-1 && $spos >= 0; ) { + for ($i = 0; $i < $pagel-1 && $spos >= 0; ) { $l = measure($shistory[$spos]); $i += $l; $spos-- if $i <= $pagel; @@ -492,6 +498,8 @@ $conn->send_later("I$call|set/page $maxshist"); #Msg->set_event_handler(\*STDIN, "read" => \&rec_stdin); +$Text::Wrap::Columns = $cols; + my $lastmin = 0; for (;;) { my $t;