X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fconsole.pl;h=887600e31ee6438ca9f96188b13fd5c2e60b5d93;hb=6ea05be3ca5b4857bb319782c408d5784658ec20;hp=97c0864c3e89e49b23b4627c4a31724618cfdcd8;hpb=bfa8589d67aebae38f9ed41b4539577ad45b8f94;p=spider.git diff --git a/perl/console.pl b/perl/console.pl index 97c0864c..887600e3 100755 --- a/perl/console.pl +++ b/perl/console.pl @@ -81,6 +81,7 @@ sub do_initscr $scr->refresh(); $pagel = LINES()-4; + $mycallcolor = COLOR_PAIR(1) unless $mycallcolor; } sub do_resize @@ -174,8 +175,11 @@ sub show_screen $spos = @shistory if $spos > @shistory; } my $shl = @shistory; - my $add = "$call-$spos-$shl"; - $scr->addstr(LINES()-4, 0, '-' x (COLS() - length $add)); + my $add = "-$spos-$shl"; + $scr->addstr(LINES()-4, 0, '-' x (COLS() - (length($call) + length($add)))); + $scr->attrset($mycallcolor) if $has_colors; + $scr->addstr("$call"); + $scr->attrset(COLOR_PAIR(0)) if $has_colors; $scr->addstr($add); $scr->refresh(); # $top->refresh(); @@ -184,9 +188,11 @@ sub show_screen # add a line to the end of the top screen sub addtotop { - my $inbuf = shift; - push @shistory, $inbuf; - shift @shistory if @shistory > $maxshist; + while (@_) { + my $inbuf = shift; + push @shistory, $inbuf; + shift @shistory if @shistory > $maxshist; + } show_screen(); } @@ -422,7 +428,7 @@ Msg->set_event_handler(\*STDIN, "read" => \&rec_stdin); for (;;) { my $t; - Msg->event_loop(1, 0.010); + Msg->event_loop(1, 1); $top->refresh() if $top->is_wintouched; $bot->refresh(); $t = time;