commit 2eb3d748b559c53a373ef072bd40f6810ecdddbe
parent 9cc878a56824fc6056aa0f6f6937f32e484c499d
Author: Steve Goldman <sgoldman@tower-research.com>
Date: Sun, 23 Nov 2008 14:29:36 -0500
make ctrl-c prompt user if sup should die ungracefully
Diffstat:
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git 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