From 2eb3d748b559c53a373ef072bd40f6810ecdddbe Mon Sep 17 00:00:00 2001 From: Steve Goldman Date: Sun, 23 Nov 2008 14:29:36 -0500 Subject: [PATCH] make ctrl-c prompt user if sup should die ungracefully --- bin/sup | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/sup b/bin/sup index 152c42c..b2b2f62 100644 --- a/bin/sup +++ b/bin/sup @@ -194,7 +194,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 @@ -208,7 +217,6 @@ begin rescue InputSequenceAborted :nothing end - case action when :quit_now break if bm.kill_all_buffers_safely -- 2.45.2