From bd20169cdc8d560af4ff0d3f6e066b79e29d50fe Mon Sep 17 00:00:00 2001 From: Aleksandar Kostadinov Date: Mon, 27 May 2019 21:59:12 +0300 Subject: [PATCH] SIGINT trap consistent with TERM behaviour --- CHANGELOG.md | 3 +++ lib/cucumber/cli/main.rb | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e83aa7ad9..0bda6e30e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,9 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo * Fix seed printed in cucumber UI to match the seed that was actually used. ([#1329](https://github.com/cucumber/cucumber-ruby/pull/1329) [deivid-rodriguez](https://github.com/deivid-rodriguez)) +* Make SIGINT/`Ctrl+c` behavior consistent with SIGTERM/`kill` behavior - now first invocation causes existing scenario to stop running and jump to `at_exit`, second invocation causes immediate exit. Before that first invocation only instructed Cucumber to exit after scenario and second invocation caused immediate exit skipping `at_exit`. + ([#1353](https://github.com/cucumber/cucumber-ruby/pull/1353) + [akostadinov](https://github.com/akostadinov)) ### Added diff --git a/lib/cucumber/cli/main.rb b/lib/cucumber/cli/main.rb index 98ee60de75..419243da3a 100644 --- a/lib/cucumber/cli/main.rb +++ b/lib/cucumber/cli/main.rb @@ -86,6 +86,7 @@ def trap_interrupt exit_unable_to_finish! if Cucumber.wants_to_quit Cucumber.wants_to_quit = true STDERR.puts "\nExiting... Interrupt again to exit immediately." + exit_unable_to_finish end end