irb
irb copied to clipboard
Add helper aliases
Description
Hello. :wave: With the new extension support in IRB 1.13.0, would it be possible to add IRB.conf[:HELPER_ALIASES] like we have for command aliases? I ask, because the HELPER_ALIASES key doesn't exist and if you try to add an alias for a helper within the existing command aliases, you'll get an stack dump. Example:
require "irb/kit"
IRB::Kit.register_helpers :clip
IRB.conf[:COMMAND_ALIASES].merge! cp: :clip
cp "Test"
# irb-1.13.1/lib/irb/context.rb:603:in `evaluate': undefined method `execute' for nil (NoMethodError)
# statement.command_class.execute(self, statement.arg)
# ^^^^^^^^
:bulb: IRB Kit is a new gem I'm using to load custom helpers within IRB.
Alternatively, if the above is not desired, it might not make sense to have a key for command and helper aliases since I'm not sure how you'd differentiate between the two (at least not easily). So maybe you should be able to alias both commands and helpers via a single key (i.e. simply: ALIASES)?
Result of irb_info
Ruby version: 3.3.1
IRB version: irb 1.13.1 (2024-05-05)
InputMethod: RelineInputMethod with Reline 0.5.7 and /Users/bkuhlmann/.inputrc
Completion: Autocomplete, ReplTypeCompletor: 0.1.6, Prism: 0.29.0, RBS: 3.4.4
.irbrc paths: /Users/bkuhlmann/.config/irb/irbrc
RUBY_PLATFORM: arm64-darwin23.4.0
LANG env: en_US.UTF-8
East Asian Ambiguous Width: 1
Terminal Emulator
iTerm2
Setting Files
~/.config/irb/irbrc (via XDG)