To reproduce, try:
$ ruby19 -rcurses -e 'Curses::getmouse'
Command output is attached.
I too noticed that the NCurses mouse functions are quite unstable if
called before initscr(), so it's probably a bug in the NCurses library.
This particular example doesn't crash for me on Linux, but that's
probably just a coincidence.
This is not a ncurses library bug, since it states that initscr() must be called before any other function of the lib. Many functions of Curses made sure that the lib was initialized, but many didn't (including getmouse). Other functions (Curses::can_change_colors?, standout, etc...) also crashed (on my old PowerBook on leopard, never on my mac pro running snow leopard).
I am unsure as to why the library is not inited when 'curses' is required, so I just added the calls to all functions that needed it.
=end