Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit d8bd02c

Browse files
committed
Fix interrupt error whilst awaiting input
1 parent 93125d9 commit d8bd02c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/cli/console.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ def prompt_for_input
6565
prompt += " [#{context.module_path}]" if context
6666
prompt += ' > '
6767

68-
input = Readline.readline(prompt, true).to_s
68+
begin
69+
input = Readline.readline(prompt, true).to_s
70+
rescue SignalException
71+
input = ''
72+
end
73+
6974
puts if input.empty?
7075
input
7176
end

0 commit comments

Comments
 (0)