diff --git a/lib/rex/ui/text/shell.rb b/lib/rex/ui/text/shell.rb index 56a323c5bfacd..fd535a6d3e3ff 100644 --- a/lib/rex/ui/text/shell.rb +++ b/lib/rex/ui/text/shell.rb @@ -122,12 +122,9 @@ def tab_complete(str) # Run the command processing loop. # def run(&block) - begin - require 'pry' - # pry history will not be loaded by default when pry is used as a breakpoint like `binding.pry` + # Only suppress Pry history if Pry is already loaded + if defined?(Pry) Pry.config.history_load = false - rescue LoadError - # Pry is a development dependency, if not available suppressing history_load can be safely ignored. end with_history_manager_context do