show_source
crashes IRB when used on some top-level constants in Ruby 3.3
#833
Labels
bug
Something isn't working
Description
Run
show_source
against these constants in Ruby 3.3 crashes IRB:Gem
DidYouMean
RUBY_DESCRIPTION
SyntaxSuggest
ErrorHighlight
This is because their source location is the Ruby binary (e.g.
/opt/rubies/3.3.0/bin/ruby
), which is of course not meant to be read for the command.In Ruby 3.2 their source locations were all
ruby
instead. And because no file is calledruby
, they'd be treated as source not available.It's worth noting that in both Ruby 3.2 and 3.3,
bundle exec
changes these constants' source location:However, in Ruby 3.2, their source location would be
ruby
if called inside the executableexe/irb
. But I couldn't find obvious cause for this from reading PRs and code in CRuby or bundler.Potential Solutions
Although the root cause if not in IRB, I think we should find a way to mitigate the issue regardless. But I'm not sure what's the best approach to check if a file is readable text instead of binary.
Result of irb_info
Terminal Emulator
What's your terminal emulator?
Setting Files
Are you using
~/.irbrc
and~/.inputrc
?The text was updated successfully, but these errors were encountered: