Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: wmorgan-sup@masanjin.net (William Morgan)
Subject: [sup-talk] nonblocking_getch
Date: Mon, 25 Feb 2008 09:38:28 -0800	[thread overview]
Message-ID: <1203959878-sup-6905@south> (raw)
In-Reply-To: <3902af2f0802202043r3c8a98ablabf458d0a99937b3@mail.gmail.com>

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 <wmorgan-sup at masanjin.net>


      reply	other threads:[~2008-02-25 17:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-21  4:43 Daniel Hilton
2008-02-25 17:38 ` William Morgan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1203959878-sup-6905@south \
    --to=wmorgan-sup@masanjin.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox