From: wmorgan-sup@masanjin.net (William Morgan)
Subject: [sup-talk] Ctrl-C causes crash
Date: Thu, 20 Nov 2008 06:28:26 -0800 [thread overview]
Message-ID: <1227191082-sup-3553@entry> (raw)
In-Reply-To: <1227127838-sup-7819@sgoldmanlinux.tower-research.com>
Reformatted excerpts from Steve Goldman's message of 2008-11-19:
> This isn't as dumb of a question as it sounds. Sometimes I'm in a sup
> buffer but mistakenly think I'm in emacs.
The illusion is complete!
> Then I type Ctrl-X/Ctrl-C and sup crashes. This is not cool.
Ctrl-C is the traditional unix forced-exit mechanism, but perhaps we
could emulate mutt and have it prompt you before quitting. (And in
contrast to regular quit, it shouldn't save state back to the index.)
> /apps/home/sgoldman/sup-src/mainline/lib/sup/buffer.rb:31:in `select'
> /apps/home/sgoldman/sup-src/mainline/lib/sup/buffer.rb:31:in `nonblocking_getch'
> bin/sup:184
>
> I tested just typing Ctrl-C and got the same log output. Any idea on how to
> make sup not crash on Ctrl-C?
bin/sup already wraps everything in a rescue Exception, so you just need
to check within the rescue block whether it's a ctrl-c exception or not.
Something like:
rescue Exception => e
exit 1 if e.is_a?(Interrupt) && BufferManager.ask_yes_or_no("Die now?")
end
--
William <wmorgan-sup at masanjin.net>
prev parent reply other threads:[~2008-11-20 14:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-19 20:52 Steve Goldman
2008-11-20 14:28 ` William Morgan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1227191082-sup-3553@entry \
--to=wmorgan-sup@masanjin.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox