Reformatted excerpts from Daniel Hilton's message of 2008-02-20:
> I've got a solution that works on my system, adding
> 'Ncurses.stdscr.nodelay1' to start_cursing, and modifying
> nonblocking_getch as follows:
> 
>   def nonblocking_getch
>     if IO.select([$stdin], nil, nil, 1)
>       repeat = c = Ncurses.getch
>       repeat = Ncurses.getch until repeat != c
>       c
>     else
>       nil
>     end
>   end

Thanks, I'm going to play around with this. If you feel like learning
git-format-patch (the wiki has some instructions), you can get your name
in the commit log (ooohhh!).

> As a side note: having added nodelay, there doesn't seem to be any
> real reason we would need to keep the IO.select... but in my brief
> experimentation I found various unpleasant side-effects when I tried
> to remove it. I guess it doesn't hurt anything to leave it in.

Yeah, the entire ncurses setup is completely cargo-cult programming. I
have no idea why it works, and changing any bit of it breaks everything
in weird ways.

-- 
William <[EMAIL PROTECTED]>
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk

Reply via email to