projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix longstanding issues with console EOL handling
[spider.git]
/
perl
/
console.pl
diff --git
a/perl/console.pl
b/perl/console.pl
index 854f3835eb6c03fd2ba7130aaab0fea498d54b67..97b6220df84dbdec0663dc3263c368bc19faee32 100755
(executable)
--- a/
perl/console.pl
+++ b/
perl/console.pl
@@
-27,6
+27,9
@@
BEGIN {
$is_win = ($^O =~ /^MS/ || $^O =~ /^OS-2/) ? 1 : 0; # is it Windows?
}
$is_win = ($^O =~ /^MS/ || $^O =~ /^OS-2/) ? 1 : 0; # is it Windows?
}
+$clusteraddr = '127.0.0.1';
+$clusterport = 27754;
+
use Mojo::IOLoop;
use DXVars;
use Mojo::IOLoop;
use DXVars;
@@
-177,13
+180,18
@@
sub measure
sub show_screen
{
if ($spos == @shistory - 1) {
sub show_screen
{
if ($spos == @shistory - 1) {
-
# if we really are scrolling thru at the end of the history
my $line = $shistory[$spos];
# if we really are scrolling thru at the end of the history
my $line = $shistory[$spos];
- $top->addstr("\n") if $spos > 0;
+ my $y = $spos;
+ if ($spos >= $pagel) {
+ $top->scrl(1);
+ $y = $pagel-1;
+# $top->addstr("\r");
+ }
+ $top->move($y, 0);
+ $top->refresh;
setattr($line);
$top->addstr($line);
setattr($line);
$top->addstr($line);
-# $top->addstr("\n");
$top->attrset(COLOR_PAIR(0)) if $has_colors;
$spos = @shistory;
$top->attrset(COLOR_PAIR(0)) if $has_colors;
$spos = @shistory;
@@
-205,8
+213,7
@@
sub show_screen
for ($i = 0; $i < $pagel && $p < @shistory; $p++) {
my $line = $shistory[$p];
my $lines = measure($line);
for ($i = 0; $i < $pagel && $p < @shistory; $p++) {
my $line = $shistory[$p];
my $lines = measure($line);
- last if $i + $lines > $pagel;
- $top->addstr("\n") if $i;
+ $top->move($i, 0);
setattr($line);
$top->addstr($line);
$top->attrset(COLOR_PAIR(0)) if $has_colors;
setattr($line);
$top->addstr($line);
$top->attrset(COLOR_PAIR(0)) if $has_colors;
@@
-239,7
+246,8
@@
sub addtotop
if ($inbuf =~ s/\x07+$//) {
beep();
}
if ($inbuf =~ s/\x07+$//) {
beep();
}
- if (length $inbuf >= $cols) {
+ $inbuf =~ s/\s+$//s;
+ if (length $inbuf > $cols) {
$Text::Wrap::Columns = $cols;
push @shistory, wrap('',"\t", $inbuf);
} else {
$Text::Wrap::Columns = $cols;
push @shistory, wrap('',"\t", $inbuf);
} else {
@@
-258,7
+266,10
@@
sub rec_socket
cease(1);
}
if (defined $msg) {
cease(1);
}
if (defined $msg) {
- my ($sort, $call, $line) = $msg =~ /^(\w)([^\|]+)\|(.*)$/;
+ my ($sort, $incall, $line) = $msg =~ /^(\w)([^\|]+)\|(.*)$/;
+
+ # change my call if my node says "tonight Michael you are Jane" or something like that...
+ $call = $incall if $call ne $incall;
$line =~ s/[\x00-\x06\x08\x0a-\x19\x1b-\x1f\x80-\x9f]/./g; # immutable CSI sequence + control characters
if ($sort && $sort eq 'D') {
$line =~ s/[\x00-\x06\x08\x0a-\x19\x1b-\x1f\x80-\x9f]/./g; # immutable CSI sequence + control characters
if ($sort && $sort eq 'D') {