Skip to content

Commit

Permalink
irb: improve pry config
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
apainintheneck committed Mar 7, 2023
1 parent 6ab6d7c commit 9f7ab25
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Library/Homebrew/dev-cmd/irb.rb
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 9f7ab25

Please sign in to comment.