* [sup-talk] [PATCH] make ctrl-c prompt user if sup should die ungracefully
@ 2008-11-23 19:29 Steve Goldman
2008-11-27 0:23 ` William Morgan
0 siblings, 1 reply; 2+ messages in thread
From: Steve Goldman @ 2008-11-23 19:29 UTC (permalink / raw)
---
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-27 0:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-23 19:29 [sup-talk] [PATCH] make ctrl-c prompt user if sup should die ungracefully Steve Goldman
2008-11-27 0:23 ` William Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox