From mboxrd@z Thu Jan 1 00:00:00 1970 From: sgoldman@tower-research.com (Steve Goldman) Date: Sun, 23 Nov 2008 14:29:36 -0500 Subject: [sup-talk] [PATCH] make ctrl-c prompt user if sup should die ungracefully Message-ID: <1227468533-sup-3252@sgoldmanlinux.tower-research.com> --- bin/sup | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/sup b/bin/sup index 124af75..cee7051 100644 --- a/bin/sup +++ b/bin/sup @@ -181,7 +181,16 @@ begin end until Redwood::exceptions.nonempty? || SuicideManager.die? - c = Ncurses.nonblocking_getch + c = + begin + Ncurses.nonblocking_getch + rescue Exception => e + if e.is_a?(Interrupt) + raise if BufferManager.ask_yes_or_no("Die ungracefully now?") + bm.draw_screen + nil + end + end next unless c bm.erase_flash @@ -195,7 +204,6 @@ begin rescue InputSequenceAborted :nothing end - case action when :quit_now break if bm.kill_all_buffers_safely -- 1.5.6.4 -- Steve Goldman sgoldman at tower-research.com T: 212.219.6014 F: 212.219.6007 Tower Research Capital, LLC 377 Broadway, 11th Fl. New York, NY 10013