summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Fitzgerald <rwfitzge@gmail.com>2013-01-05 20:09:06 -0800
committerRyan Fitzgerald <rwfitzge@gmail.com>2013-08-25 17:06:06 -0700
commitae0f4f5e21b697162d75f4daa528be5b91387c06 (patch)
tree93563d6955fe638222693e61a4a96d73db66ac56
parent0c0e0862541fea55bc0165426cbda5fd60218f44 (diff)
downloadpry-ae0f4f5e21b697162d75f4daa528be5b91387c06.tar.gz
Move interrupt handling into readline
-rw-r--r--lib/pry/repl.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pry/repl.rb b/lib/pry/repl.rb
index dd4226d5..9a43aa6a 100644
--- a/lib/pry/repl.rb
+++ b/lib/pry/repl.rb
@@ -146,13 +146,13 @@ class Pry
def handle_read_errors
exception_count = 0
+ begin
+ yield
# Handle <Ctrl+C> like Bash: empty the current input buffer, but don't
# quit. This is only for MRI 1.9; other versions of Ruby don't let you
# send Interrupt from within Readline.
- begin
- yield
rescue Interrupt
- raise
+ return :control_c
# If we get a random error when trying to read a line we don't want to
# automatically retry, as the user will see a lot of error messages
# scroll past and be unable to do anything about it.