guard/guard — pull request #201 by Maher4Ever (2011-12-23 01:20:32+00:00)
Title: Fix terminal status after interrupting the Readline interactor

Hey there,

I have been using the new 0.9.1 for a few days now I noticed that it was messing up my terminal when I stopped Guard using a signal such as CTRL+C.

I looked into it today and I found out (after reading a bit about the Readline gem) that the ruby interpreter doesn't restore the status of the terminal if it was interrupted.

Now with the new 0.9.2 and the separation of the interactors, it was even easier to implement a fix :).

One good side-effect for this patch is the better handing for the INT signal in general. Now Guard closes nicely when it's interrupted and will inform all guards to stop.

All the additions I made come with tests for the important parts.