diff --git a/lib/pry.rb b/lib/pry.rb index 0b13970b..e1fadffa 100644 --- a/lib/pry.rb +++ b/lib/pry.rb @@ -104,7 +104,7 @@ class Pry DEFAULT_CONTROL_D_HANDLER = proc do |eval_string, _pry_| if !eval_string.empty? # clear input buffer - eval_string.clear + eval_string.replace("") elsif _pry_.binding_stack.one? # ^D at top-level breaks out of loop _pry_.binding_stack.clear diff --git a/lib/pry/default_commands/editing.rb b/lib/pry/default_commands/editing.rb index 237d7cb4..ef88dbf4 100644 --- a/lib/pry/default_commands/editing.rb +++ b/lib/pry/default_commands/editing.rb @@ -10,7 +10,7 @@ class Pry create_command "!", "Clear the input buffer. Useful if the parsing process goes wrong and you get stuck in the read loop.", :use_prefix => false do def process output.puts "Input buffer cleared!" - eval_string.clear + eval_string.replace("") end end diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb index bfa8f5d3..fbc9ec68 100644 --- a/lib/pry/pry_instance.rb +++ b/lib/pry/pry_instance.rb @@ -348,7 +348,7 @@ class Pry # from within Readline. rescue Interrupt output.puts "" - eval_string.clear + eval_string.replace("") return end