Skip Menu |

This queue is for tickets about the TermReadKey CPAN distribution.

Report information
The Basics
Id: 88266
Status: resolved
Priority: 0/
Queue: TermReadKey

People
Owner: Nobody in particular
Requestors: jpeacock [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.30
Fixed in: (no value)



Subject: Add `stty size` option to GetTerminalSize()
Add one more potential method to GetTerminalSise(). See attached patch.
Subject: readkey-stty.patch
Index: ReadKey.pm =================================================================== --- ReadKey.pm (revision 55948) +++ ReadKey.pm (working copy) @@ -359,6 +359,27 @@ if ( @results < 4 ) { + my ($prog) = "stty size"; + + my ($stty) = scalar(`$prog 2>/dev/null`); + if ( + defined $stty + and ( $stty =~ /(\d+) (\d+)/ ) + ) + { + $results[0] = $2; + $results[1] = $1; + @results[ 2, 3 ] = ( 0, 0 ); + } + else + { + @results = (); + } + push( @fail, "stty program" ); + } + + if ( @results < 4 ) + { die "Unable to get Terminal Size." . join( "", map( " The $_ didn't work.", @fail ) ); }
On Thu Aug 29 10:48:47 2013, JPEACOCK wrote: Show quoted text
> Add one more potential method to GetTerminalSise(). See attached patch.
Thanks added as https://github.com/jonathanstowe/TermReadKey/commit/fecf18b85c23af494f2aa3f8ebad05754097c097 belatedly