summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0xAB <0xAB@protonmail.com>2017-08-28 05:16:28 +0100
committer0xAB <0xAB@protonmail.com>2017-08-28 05:16:28 +0100
commite6b58587002a8174307a6069aa6d64ec02554267 (patch)
treed2cc39e40d0ea67564e21bfae92a526f56687e0e
parent5f83fe196074b9b81b37133ae575cee5ff131a0a (diff)
downloadpry-e6b58587002a8174307a6069aa6d64ec02554267.tar.gz
0 isnt valid as response
-rw-r--r--lib/pry/commands/change_prompt.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pry/commands/change_prompt.rb b/lib/pry/commands/change_prompt.rb
index 36382d09..1fff0451 100644
--- a/lib/pry/commands/change_prompt.rb
+++ b/lib/pry/commands/change_prompt.rb
@@ -29,7 +29,7 @@ class Pry::Command::ChangePrompt < Pry::ClassCommand
end
output.write "Choice: "
reply = _pry_.input.respond_to?(:gets) ? _pry_.input.gets : _pry_.input.readline
- if reply =~ /^\d+$/ and reply.to_i <= prompts.size
+ if reply =~ /^[1-9]+$/ and reply.to_i <= prompts.size
_pry_.prompt = prompts[reply.to_i-1].proc_array
else
multiple_choice(prompts)