fiz console.pl resizing
authorDirk Koopman <djk@tobit.co.uk>
Fri, 10 Dec 2021 16:34:48 +0000 (16:34 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Fri, 10 Dec 2021 16:34:48 +0000 (16:34 +0000)
Changes
perl/DXChannel.pm
perl/console.pl

diff --git a/Changes b/Changes
index b2e733f9e2b4a08993b69ab3b818a9613552abdd..1c67d0afc3fe0938a205b08772620dc34427a38e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
 10Dec21=======================================================================
 1. Fix the output of set/dxgrid, set/usstate and set/dxcq or set/dxitu to how
    it was always supposed to be since 2003.
+2. Fix console.pl resizing.
 09Dec21=======================================================================
 1. Moved isregistered to DXChannel for safety...
 08Dec21=======================================================================
index 40efdd245c5445be1e4c4c1fd06f81dac31267a0..f2a1638cdf0c101817bc92a8aa22c795472bf43b 100644 (file)
@@ -724,6 +724,8 @@ sub process
                                $dxchan->disconnect;
                        } elsif ($sort eq 'D') {
                                ;                               # ignored (an echo)
+                       } elsif ($sort eq 'C') {
+                               $dxchan->width($line); # change number of columns
                        } elsif ($sort eq 'G') {
                                $dxchan->enhanced($line);
                        } else {
index 6651272460eeba69b7c01fe46583785fadafbf52..6c93d5ff44aca8e762d6caddefbc8898624ab99d 100755 (executable)
@@ -131,6 +131,8 @@ sub do_resize
        $inscroll = 0;
        $spos = @sh < $pagel ? 0 :  @sh - $pagel;
        show_screen();
+       $conn->send_later("C$call|$cols") if $conn;
+       
 }
 
 # cease communications
@@ -242,7 +244,10 @@ sub addtotop
                        $inbuf =~ s/\s+/ /g;
                        if (length $inbuf > $cols) {
                                $Text::Wrap::columns = $cols;
-                               push @sh, split /\n/, wrap('',' ' x 19, $inbuf);
+                               my $token;
+                               ($token) = $inbuf =~ m!^(.* de [-\w\d/\#]+\s+|\w{9}\@\d\d:\d\d:\d\d )!;
+                               $token ||= ' ' x 19;
+                               push @sh, split /\n/, wrap('', ' ' x length($token), $inbuf);
                        } else {
                                push @sh, $inbuf;
                        }