add sysop defined 'run' script and privilege commands
[spider.git] / perl / console.pl
index 46e7a1ea6c1df7c9c8eb4e2ba09f43edd26892cc..f4c4a85fa37731c163379cdf3b21b9b84d609b35 100755 (executable)
@@ -32,6 +32,7 @@ use DXDebug;
 use DXUtil;
 use DXDebug;
 use IO::File;
+use Time::HiRes qw(gettimeofday tv_interval);
 use Curses 1.06;
 
 use Console;
@@ -50,6 +51,9 @@ $connsort = "local";
 $khistpos = 0;
 $spos = $pos = $lth = 0;
 $inbuf = "";
+@time = ();
+
+$SIG{WINCH} = sub {@time = gettimeofday};
 
 sub mydbg
 {
@@ -114,8 +118,6 @@ sub do_resize
        $has_colors = has_colors();
        do_initscr();
 
-       $winch = 0;
-       $SIG{'WINCH'} = sub {$winch = 1};
        show_screen();
 }
 
@@ -504,7 +506,7 @@ for (;;) {
                $lasttime = $t;
        }
        my $ch = $bot->getch();
-       if ($winch) {
+       if (@time && tv_interval(\@time, [gettimeofday]) >= 1) {
 #              mydbg("Got Resize");
 #              do_resize();
                next;