neovim/neovim — pull request #410 by tarruda (2014-03-27 12:39:01+00:00)
Title: Move signal handling to libuv event loop

This removes all signal handling code from os_unix.c to os/signal.c, which
registers watchers on libuv default loop. Now signal handling will only happen
when Neovim transfers control to libuv, and SIG{HUP,TERM,QUIT} are the only
deadly signals intercepted.

I removed excessive signal handling code. For example, before it tried to handle SIGABRT which normally generates a core dump by exiting cleanly. Vim only generated core core dumps explicitly with `may_core_dump` function, and if the signal was received multiple times. This shouldn't happen with libuv since signals are delivered synchronously to `signal_cb` and only when libuv is polling for events. Signals such as SIGABRT normally mean program errors(eg: failed assertions) and should probably exit imediatelly. SIG{HUP,TERM,QUIT} are the only deadly signals we are handling because these are not related to bugs.

There may still be a resize problem with the `RealWaitForChar` in `mch_call_shell` since that still uses `select/poll` directly, but it should be fixed when `mch_call_shell` is reimplemented with libuv process facilities

@philix / @stefan991 Are the OS X redrawing problems fixed in this branch?