X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fconsole.pl;fp=perl%2Fconsole.pl;h=88ffb92787589a527ebf03f51983b053de466bdb;hb=70990c34d1dabdc17fe93d33a06a4b9097b30ee8;hp=597c5eff0ee2010764a9e533732c14b8cd23a38b;hpb=69392cc0b1f7cd7ff83ebfa30949b543bd12eedb;p=spider.git diff --git a/perl/console.pl b/perl/console.pl index 597c5eff..88ffb927 100755 --- a/perl/console.pl +++ b/perl/console.pl @@ -23,14 +23,6 @@ BEGIN { unshift @INC, "$root/perl"; # this IS the right way round! unshift @INC, "$root/local"; - - sub main::mkver - { - my $s = shift; - my ($v, $b) = $s =~ /(\d+\.\d+)(?:\.(\d+\.\d+))?/; - $main::build += sprintf "%.3f", $v; - $main::branch += sprintf("%.3f", $b) if $b; - } } use Msg; @@ -42,6 +34,7 @@ use DXDebug; use IO::File; use Time::HiRes qw(gettimeofday tv_interval); use Curses 1.06; +use Text::Wrap; use Console; @@ -237,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(); } @@ -500,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;