X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fconsole.pl;h=41fc953e4785905e06e1f0e1e490b6260fc03e72;hb=6db883c129fb84bbf067861a1def1fd8120a32c8;hp=8af9f3b3aed640fb6500efa34d1c471a1f192b38;hpb=0aaec2fed8977d5e1cd02a4f1432bdde135a1044;p=spider.git diff --git a/perl/console.pl b/perl/console.pl index 8af9f3b3..41fc953e 100755 --- a/perl/console.pl +++ b/perl/console.pl @@ -224,6 +224,9 @@ sub addtotop { while (@_) { my $inbuf = shift; + if ($inbuf =~ s/\x07+$//) { + beep(); + } push @shistory, $inbuf; shift @shistory if @shistory > $maxshist; } @@ -240,8 +243,9 @@ sub rec_socket if (defined $msg) { my ($sort, $call, $line) = $msg =~ /^(\w)([^\|]+)\|(.*)$/; + $line =~ s/[\x00-\x06\x08\x0a-\x19\x1b-\x1f\x80-\x9f\xf0-\xff]/./g; # immutable CSI sequence + control characters if ($sort && $sort eq 'D') { - $line = " " unless $line; + $line = " " unless length($line); addtotop($line); } elsif ($sort && $sort eq 'Z') { # end, disconnect, go, away ..... cease(0); @@ -269,11 +273,12 @@ sub rec_stdin # print "sys: $r ($prbuf)\n"; if (defined $r) { + $r = '0' if !$r; if ($r eq KEY_ENTER || $r eq "\n" || $r eq "\r") { # save the lines - $inbuf = " " unless $inbuf; + $inbuf = " " unless length($inbuf); # check for a pling and do a search back for a command if ($inbuf =~ /^!/o) { @@ -392,7 +397,7 @@ sub rec_stdin } elsif ($r eq KEY_RESIZE || $r eq "\0632") { do_resize(); return; - } elsif (is_pctext($r)) { + } elsif (defined is_pctext($r)) { # move the top screen back to the bottom if you type something if ($spos < @shistory) { $spos = @shistory; @@ -481,7 +486,7 @@ $SIG{__DIE__} = \&sig_term; $conn->send_later("A$call|$connsort width=$cols"); $conn->send_later("I$call|set/page $maxshist"); -$conn->send_later("I$call|set/nobeep"); +#$conn->send_later("I$call|set/nobeep"); #Msg->set_event_handler(\*STDIN, "read" => \&rec_stdin);