From c59ccbb93b031b6c06f3b0cd57c778f459db2942 Mon Sep 17 00:00:00 2001 From: Dean Welch Date: Mon, 6 Jul 2026 11:34:54 +0100 Subject: [PATCH] Suppress Pry history loading only if Pry is already defined --- lib/rex/ui/text/shell.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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