[poe-commits] SF.net SVN: poe: [2293] trunk/poe/lib/POE/Wheel/ReadLine.pm
Brought to you by:
rcaputo
From: <rc...@us...> - 2008-03-23 01:19:42
|
Revision: 2293 http://poe.svn.sourceforge.net/poe/?rev=2293&view=rev Author: rcaputo Date: 2008-03-22 18:19:48 -0700 (Sat, 22 Mar 2008) Log Message: ----------- Fall back to an 80x25 terminal size if Term::ReadKey::GetTerminalSize fails. Modified Paths: -------------- trunk/poe/lib/POE/Wheel/ReadLine.pm Modified: trunk/poe/lib/POE/Wheel/ReadLine.pm =================================================================== --- trunk/poe/lib/POE/Wheel/ReadLine.pm 2008-03-22 22:22:40 UTC (rev 2292) +++ trunk/poe/lib/POE/Wheel/ReadLine.pm 2008-03-23 01:19:48 UTC (rev 2293) @@ -735,7 +735,8 @@ # the input state engine (so that we have valid values) and # before handing control back to the user (so that they get # an up-to-date value). - ($trk_cols, $trk_rows) = GetTerminalSize($stdout); + eval { ($trk_cols, $trk_rows) = GetTerminalSize($stdout) }; + ($trk_cols, $trk_rows) = (80, 25) if $@; # Configuration... # Some things are optional. @@ -1030,7 +1031,8 @@ return if $self->[SELF_READING_LINE]; # recheck the terminal size every prompt, in case the size # has changed - ($trk_cols, $trk_rows) = GetTerminalSize($stdout); + eval { ($trk_cols, $trk_rows) = GetTerminalSize($stdout) }; + ($trk_cols, $trk_rows) = (80, 25) if $@; ReadMode('ultra-raw'); # Tell the terminal that we want to be in 'application' mode. @@ -1779,7 +1781,8 @@ $self->[SELF_HIST_INDEX] = @{$self->[SELF_HIST_LIST]}; $self->_flush_output_buffer; ReadMode('restore'); - ($trk_cols, $trk_rows) = GetTerminalSize($stdout); + eval { ($trk_cols, $trk_rows) = GetTerminalSize($stdout) }; + ($trk_cols, $trk_rows) = (80, 25) if $@; if ($self->[SELF_KEYMAP]->{name} =~ /vi/) { $self->rl_set_keymap('vi-insert'); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |