X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fconsole.pl;h=14c95bac6b14505493d4891098c1a8b117187b7c;hb=7b04a3d44f31ef2524a67c4498d686335477ee07;hp=2a88f5b5db7aff99cd7dc3bf8d2ba86f6b3f5ef4;hpb=9e6322c41076ff462cb37416e28c3742567dc62a;p=spider.git diff --git a/perl/console.pl b/perl/console.pl index 2a88f5b5..14c95bac 100755 --- a/perl/console.pl +++ b/perl/console.pl @@ -134,6 +134,7 @@ sub doresize $inscroll = 0; $spos = @sh < $pagel ? 0 : @sh - $pagel; show_screen(); + $conn->send_later("C$call|$cols") if $conn; } # cease communications @@ -518,10 +519,10 @@ sub idle_loop } my $ch = $bot->getch(); # this is here just to catch RESIZE events if (defined $ch) { - if ($ch == KEY_RESIZE) { + if ($ch eq KEY_RESIZE) { doresize(); } else { - rec_stdin($ch) unless $ch == '-1'; + rec_stdin($ch) unless $ch eq '-1'; } } $top->refresh() if $top->is_wintouched; @@ -550,7 +551,11 @@ sub on_disconnect while (@ARGV && $ARGV[0] =~ /^-/) { my $arg = shift; - dbgadd('console'), $maxshist = 200 if $arg eq '-x'; + if ($arg eq '-x') { + dbginit(); + dbgadd('console'); + $maxshist = 200; + } } $call = uc shift @ARGV if @ARGV; @@ -569,8 +574,6 @@ if ($call eq $mycall) { exit(0); } -dbginit(); - unless ($DB::VERSION) { $SIG{'INT'} = \&sig_term; $SIG{'TERM'} = \&sig_term; @@ -592,7 +595,7 @@ $conn = IntMsg->connect($clusteraddr, $clusterport, rproc => \&rec_socket); $conn->{on_connect} = \&on_connect; $conn->{on_disconnect} = \&on_disconnect; -my $timer = Mojo::IOLoop->recurring(1, sub {DXLog::flushall()}); +my $timer = Mojo::IOLoop->recurring(1, sub {DXLog::flushall()}) if $DXDebug::fp; $idle = Mojo::IOLoop->recurring(0.100 => \&idle_loop); Mojo::IOLoop->singleton->reactor->io(\*STDIN => sub {