Subject: [sup-talk] [PATCH] make ctrl-c prompt user if sup should die ungracefully

From: [email-masked] (Steve Goldman)
Date: Sun, 23 Nov 2008 14:29:36 -0500

---
 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

---

From: [email-masked] (William Morgan)
Date: Wed, 26 Nov 2008 16:23:24 -0800

Applied, thanks!
-- 
William <wmorgan-sup at masanjin.net>