$scr->refresh();
$pagel = LINES()-4;
+ $mycallcolor = COLOR_PAIR(1) unless $mycallcolor;
}
sub do_resize
if ($spos == @shistory - 1) {
# if we really are scrolling thru at the end of the history
- my $line = $shistory[-1];
+ my $line = $shistory[$spos];
$top->addstr("\n") if $spos > 0;
setattr($line);
$top->addstr($line);
# anywhere else
my ($i, $l);
my $p = $spos-1;
- for ($i = 0; $i <= $pagel && $p >= 0; ) {
+ for ($i = 0; $i < $pagel && $p >= 0; ) {
$l = measure($shistory[$p]);
$i += $l;
$p-- if $i < $pagel;
$top->move(0, 0);
$top->attrset(COLOR_PAIR(0)) if $has_colors;
$top->clrtobot();
- for ($i = 0; $i <= $pagel && $p < @shistory; $p++) {
+ for ($i = 0; $i < $pagel && $p < @shistory; $p++) {
my $line = $shistory[$p];
my $lines = measure($line);
last if $i + $lines > $pagel;
- $top->move($i, 0);
setattr($line);
- $top->addstr($line);
+ $top->addstr($i, 0, $line);
$top->attrset(COLOR_PAIR(0)) if $has_colors;
$i += $lines;
}
$spos = $p;
+ $spos = @shistory if $spos > @shistory;
}
- $top->refresh();
+ my $shl = @shistory;
+ 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();
}
# add a line to the end of the top screen
if (defined $msg) {
my ($sort, $call, $line) = $msg =~ /^(\w)(\S+)\|(.*)$/;
- if ($sort eq 'D') {
+ if ($sort && $sort eq 'D') {
addtotop($line);
- } elsif ($sort eq 'Z') { # end, disconnect, go, away .....
+ } elsif ($sort && $sort eq 'Z') { # end, disconnect, go, away .....
cease(0);
}
}
}
# add it to the monitor window
+ unless ($spos == @shistory) {
+ $spos = @shistory;
+ show_screen();
+ };
addtotop($inbuf) if $inbuf;
# send it to the cluster
$i += $l;
$spos++ if $i <= $pagel;
}
- $spos = @shistory if $spos > @shistory;
+ $spos = @shistory if $spos >= @shistory - 1;
show_screen();
} else {
beep();
}
} elsif ($r ge ' ' && $r le '~') {
# move the top screen back to the bottom if you type something
- if ($spos < @shistory - 1) {
+ if ($spos < @shistory) {
$spos = @shistory;
show_screen();
}
for (;;) {
my $t;
- Msg->event_loop(1, 0.010);
+ Msg->event_loop(1, 1);
$top->refresh() if $top->is_wintouched;
$bot->refresh();
$t = time;