diff --git a/lib/pry.rb b/lib/pry.rb index 86ed4723..963c7445 100644 --- a/lib/pry.rb +++ b/lib/pry.rb @@ -114,7 +114,7 @@ class Pry end, ] - DEFAULT_SYSTEM = proc do |cmd| + DEFAULT_SYSTEM = proc do |output, cmd, _| if !system(cmd) output.puts "Error: there was a problem executing system command: #{cmd}" end diff --git a/lib/pry/config.rb b/lib/pry/config.rb index c5924fc8..28fb7a20 100644 --- a/lib/pry/config.rb +++ b/lib/pry/config.rb @@ -120,7 +120,8 @@ class Pry attr_accessor :control_d_handler # @return [Proc] The proc that runs system commands - # The proc is passed the command string to eval + # The proc is passed the pry output object, the command string + # to eval, and a reference to the pry instance attr_accessor :system end end diff --git a/lib/pry/default_commands/shell.rb b/lib/pry/default_commands/shell.rb index d9754ec2..0987feca 100644 --- a/lib/pry/default_commands/shell.rb +++ b/lib/pry/default_commands/shell.rb @@ -12,7 +12,7 @@ class Pry output.puts "No such directory: #{dest}" end else - Pry.config.system.call(cmd) + Pry.config.system.call(output, cmd, _pry_) end end