Skip to content

Commit

Permalink
Turn blocking back on for STDIN, or some curses libraries won't
Browse files Browse the repository at this point in the history
properly refresh the display.
  • Loading branch information
rcaputo committed Mar 5, 2002
1 parent 4f6d4a6 commit a1ab353
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/POE/Wheel/Curses.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ $VERSION = (qw($Revision$ ))[1];

use Carp qw(croak);
use Curses;
use POSIX qw(fcntl_h);
use POE qw(Wheel);


sub SELF_STATE_READ () { 0 }
sub SELF_STATE_WRITE () { 1 }
sub SELF_EVENT_INPUT () { 2 }
Expand Down Expand Up @@ -101,6 +103,11 @@ sub _define_input_state {

# Now start reading from it.
$poe_kernel->select_read( \*STDIN, $self->[SELF_STATE_READ] );

# Turn blocking back on for STDIN. Some Curses implementations
# don't deal well with non-blocking STDIN.
my $flags = fcntl(STDIN, F_GETFL, 0) or die $!;
fcntl(STDIN, F_SETFL, $flags & ~O_NONBLOCK) or die $!;
}
else {
$poe_kernel->select_read( \*STDIN );
Expand Down

0 comments on commit a1ab353

Please sign in to comment.