From 9f7ab25af5f857dcaf1fbff488ad9630c2781160 Mon Sep 17 00:00:00 2001 From: apainintheneck Date: Mon, 6 Mar 2023 22:37:09 -0800 Subject: [PATCH] irb: improve pry config The idea here is that the pry session history should be separate for homebrew than the global pry history. We also ignore any .pryrc files so that they don't interfere with this config. --- Library/Homebrew/dev-cmd/irb.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index eabeb0943e1c3..dd1c6bf21ec83 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -54,7 +54,6 @@ def irb if args.pry? Homebrew.install_gem_setup_path! "pry" require "pry" - Pry.config.prompt_name = "brew" else require "irb" end @@ -65,6 +64,11 @@ def irb ohai "Interactive Homebrew Shell", "Example commands available with: `brew irb --examples`" if args.pry? + Pry.config.should_load_rc = false # skip loading .pryrc + Pry.config.history_file = (HOMEBREW_REPOSITORY/".pry_history").to_s + Pry.config.memory_size = 100 # max lines to save to history file + Pry.config.prompt_name = "brew" + Pry.start else ENV["IRBRC"] = (HOMEBREW_REPOSITORY/".irb_config").to_s