This queue is for tickets about the TermReadKey CPAN distribution.

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

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

BugTracker
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


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.