From b34cd1acfb4aee0d735b317697780edc9e8c42b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=CC=81my=20Coutable?= Date: Sat, 30 Jul 2011 23:58:53 +0200 Subject: [PATCH] Based on @ttilley explanation in https://github.com/thibaudgg/rb-fsevent/issues/17, signal handlers registration should happen before any subprocess creation (fsevent_watch for instance) to be properly catches by the subprocess. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note that in the case when guard is run via bundler, this –quoting @ttilley– "would make this an unsolvable problem" (isn't it dramatic?! ;)). --- lib/guard.rb | 3 ++- lib/guard/interactor.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/guard.rb b/lib/guard.rb index ae6b8fb..5b2e21e 100644 --- a/lib/guard.rb +++ b/lib/guard.rb @@ -24,9 +24,10 @@ module Guard end def start(options = {}) + Interactor.init_signal_traps + setup(options) - Interactor.init_signal_traps Dsl.evaluate_guardfile(options) listener.on_change do |files| diff --git a/lib/guard/interactor.rb b/lib/guard/interactor.rb index 3b65598..1170053 100644 --- a/lib/guard/interactor.rb +++ b/lib/guard/interactor.rb @@ -37,7 +37,7 @@ module Guard stop end else - UI.info "Your system doesn't support INT signal, so Ctrl-C (stop) won't work" + UI.info "Your system doesn't support INT signal, so Ctrl-C (Stop) won't work" end # Reload (Ctrl-Z)