diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb index 9d9db3a6..e5be2bf5 100644 --- a/lib/pry/pry_instance.rb +++ b/lib/pry/pry_instance.rb @@ -97,13 +97,15 @@ class Pry attributes = [ :input, :output, :commands, :print, :quiet, :exception_handler, :hooks, :custom_completions, - :prompt, :memory_size, :input_stack, :extra_sticky_locals + :prompt, :memory_size, :extra_sticky_locals ] attributes.each do |attribute| defaults[attribute] = Pry.send attribute end + defaults[:input_stack] = Pry.input_stack.dup + defaults.merge!(options).each do |key, value| send("#{key}=", value) if respond_to?("#{key}=") end