diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb index 31f2df4b..836bdbae 100644 --- a/lib/pry/pry_instance.rb +++ b/lib/pry/pry_instance.rb @@ -245,12 +245,11 @@ class Pry # exit session if we receive EOF character (^D) if !val output.puts - if binding_stack.size == 1 - + if binding_stack.one? # ^D at top-level breaks out of loop + binding_stack.clear throw(:breakout) else - # otherwise just pops a binding binding_stack.pop val = ""