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

require-ing in irbrc shows warning "can't alias ls from irb_ls" #56

Closed
stefanwascoding opened this issue Apr 22, 2021 · 1 comment
Closed

Comments

@stefanwascoding
Copy link

When one requires this gem in the irbrc file, you get a warning on irb startup, from ruby 2.7 onwards (tested in 2.7.1 and 3.0.0):

% irb -f -r'looksee'
irb: warn: can't alias ls from irb_ls.
irb(main):001:0>

If you require the gem after irb has finished loading, there is no issue.

% irb -f
irb(main):001:0> require 'looksee'
=> true
irb(main):002:0>

Main difference seems to be the result of show_source 'ls' (in REPL). For the startup (and command line) case it shows Looksee, otherwise irb/extend-command.rb.

Warning goes away if one adds Looksee.rename :_ls to irbrc ... but considering this happens for a straightforward installation, it seems like that should not be necessary. Would be great if require-ing looksee in irbrc and during REPL would behave the same way.

Probably relevant:

@zw963
Copy link
Contributor

zw963 commented Oct 5, 2022

I can reproduce this issue too on ruby 3.1.2, and Looksee.rename :_ls hacks works for me.

@oggy oggy closed this as completed in c336b95 Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants