X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fconsole.pl;h=88ffb92787589a527ebf03f51983b053de466bdb;hb=e69a98ce612592a78aca2a3ac4e2388a06059955;hp=bc3ca0d67bcb41163bd539e953e5f469daef960b;hpb=5faa3742af7d0a5f2c5d28cd98efd37214f677dc;p=spider.git diff --git a/perl/console.pl b/perl/console.pl index bc3ca0d6..88ffb927 100755 --- a/perl/console.pl +++ b/perl/console.pl @@ -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(); } @@ -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;