Skip to content

Commit

Permalink
Regard EOF as continue in LocalInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Oct 10, 2015
1 parent fc1eb51 commit faa5894
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/byebug/interfaces/local_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module Byebug
# Interface class for standard byebug use.
#
class LocalInterface < Interface
EOF_ALIAS = 'continue'

def initialize
super()
@input = STDIN
Expand All @@ -13,12 +15,12 @@ def initialize
#
# Reads a single line of input using Readline. If Ctrl-C is pressed in the
# middle of input, the line is reset to only the prompt and we ask for input
# again.
# again. If Ctrl-D is pressed, it returns "continue".
#
# @param prompt Prompt to be displayed.
#
def readline(prompt)
Readline.readline(prompt, false)
Readline.readline(prompt, false) || EOF_ALIAS
rescue Interrupt
puts('^C')
retry
Expand Down

0 comments on commit faa5894

Please sign in to comment.