#
# Copyright (c) 1999 Dirk Koopman G1TLH
#
-# $Id$
+#
#
require 5.004;
unshift @INC, "$root/perl"; # this IS the right way round!
unshift @INC, "$root/local";
+ $is_win = ($^O =~ /^MS/ || $^O =~ /^OS-2/) ? 1 : 0; # is it Windows?
}
use Msg;
use IO::File;
use Time::HiRes qw(gettimeofday tv_interval);
use Curses 1.06;
+use Text::Wrap;
use Console;
$inbuf = "";
@time = ();
-$SIG{WINCH} = sub {@time = gettimeofday};
+#$SIG{WINCH} = sub {@time = gettimeofday};
sub mydbg
{
init_pair(12, COLOR_MAGENTA, COLOR_BLUE);
init_pair(13, COLOR_YELLOW, COLOR_GREEN);
init_pair(14, COLOR_RED, COLOR_GREEN);
- eval { assume_default_colors($foreground, $background) };
+ eval { assume_default_colors($foreground, $background) } unless $is_win;
}
-
+
$top = $scr->subwin($lines-4, $cols, 0, 0);
$top->intrflush(0);
$top->scrollok(1);
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();
}
} elsif ($r eq KEY_PPAGE || $r eq "\032") {
if ($spos > 0) {
my ($i, $l);
- for ($i = 0; $i <= $pagel && $spos >= 0; ) {
+ for ($i = 0; $i < $pagel-1 && $spos >= 0; ) {
$l = measure($shistory[$spos]);
$i += $l;
$spos-- if $i <= $pagel;
#Msg->set_event_handler(\*STDIN, "read" => \&rec_stdin);
+$Text::Wrap::Columns = $cols;
+
my $lastmin = 0;
for (;;) {
my $t;