Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IRBRC file is loaded every time ruby reaches binding.irb #625

Closed
tompng opened this issue Jul 4, 2023 · 0 comments · Fixed by #850
Closed

IRBRC file is loaded every time ruby reaches binding.irb #625

tompng opened this issue Jul 4, 2023 · 0 comments · Fixed by #850
Labels
bug Something isn't working

Comments

@tompng
Copy link
Member

tompng commented Jul 4, 2023

Description

If you have .irbrc file

puts 'irbrc file loaded'

You can see that binding.irb loads .irbrc every time.

$ irb -f
irb(main):001:0> 4.times{binding.irb}
irbrc file loaded
irb(main):001:0> exit
irbrc file loaded
irb(main):001:0> exit
irbrc file loaded
irb(main):001:0> exit
irbrc file loaded
irb(main):001:0> exit
=> 4
irb(main):002:0> exit
$

binding.irb loads .irbrc even if command line option -f (Don't initialize from configuration file) is specified.
I think it should follow -f option. Maybe it should load only once.
For reference, IRB's command irb (Start a child IRB) does not load .irbrc.

Result of irb_info

irb(main):001:0> irb_info
Ruby version: 3.2.2
IRB version: irb 1.7.1 (2023-07-01)
InputMethod: RelineInputMethod with Reline 0.3.5
.irbrc path: /Users/tomoya.ishida/.irbrc
RUBY_PLATFORM: arm64-darwin22
LANG env: ja_JP.UTF-8
East Asian Ambiguous Width: 1

Terminal Emulator

Terminal.app

Setting Files

# ~/.irbrc
puts 'irbrc file loaded'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
2 participants