From 74db48555c9a548e2ef49815234af3fc2b8ecd81 Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Fri, 10 Dec 2021 16:34:48 +0000 Subject: [PATCH] fiz console.pl resizing --- Changes | 1 + perl/DXChannel.pm | 2 ++ perl/console.pl | 7 ++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index b2e733f9..1c67d0af 100644 --- 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======================================================================= diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index 40efdd24..f2a1638c 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -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 { diff --git a/perl/console.pl b/perl/console.pl index 66512724..6c93d5ff 100755 --- a/perl/console.pl +++ b/perl/console.pl @@ -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; } -- 2.43.0