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

Crash when pressing TAB key on a hash #769

Closed
ahangarha opened this issue Nov 19, 2023 · 3 comments
Closed

Crash when pressing TAB key on a hash #769

ahangarha opened this issue Nov 19, 2023 · 3 comments

Comments

@ahangarha
Copy link

Description

One should be able to use TAB key for autocomplete or navigate between available methods on an object. If one wants to do the same on a {}. and press TAB (with any text written or not), the irb crashes with the following error:

/home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.9.0/lib/irb/input-method.rb:315:in `block in show_doc_dialog_proc': undefined method `match?' for ["Proc.dup", "Hash.dup"]:Array (NoMethodError)

        show_easter_egg = name&.match?(/\\ARubyVM/) && !ENV['RUBY_YES_I_AM_NOT_A_NORMAL_USER']
                              ^^^^^^^^
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline/line_editor.rb:588:in `instance_exec'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline/line_editor.rb:588:in `call'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline/line_editor.rb:623:in `call'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline/line_editor.rb:776:in `update_each_dialog'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline/line_editor.rb:652:in `block in render_dialog'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline/line_editor.rb:650:in `map'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline/line_editor.rb:650:in `render_dialog'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline/line_editor.rb:500:in `rerender'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline.rb:351:in `block (3 levels) in inner_readline'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline.rb:349:in `each'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline.rb:349:in `block (2 levels) in inner_readline'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline.rb:424:in `block in read_io'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline.rb:394:in `loop'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline.rb:394:in `read_io'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline.rb:347:in `block in inner_readline'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline.rb:345:in `loop'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline.rb:345:in `inner_readline'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline.rb:273:in `block in readmultiline'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline/ansi.rb:152:in `block in with_raw_input'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline/ansi.rb:152:in `raw'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline/ansi.rb:152:in `with_raw_input'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/reline-0.4.0/lib/reline.rb:269:in `readmultiline'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/3.1.0/forwardable.rb:238:in `readmultiline'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.9.0/lib/irb/input-method.rb:449:in `gets'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.9.0/lib/irb.rb:539:in `block in read_input'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.9.0/lib/irb.rb:823:in `signal_status'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.9.0/lib/irb.rb:537:in `read_input'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.9.0/lib/irb.rb:559:in `readmultiline'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.9.0/lib/irb.rb:586:in `block in each_top_level_statement'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.9.0/lib/irb.rb:585:in `loop'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.9.0/lib/irb.rb:585:in `each_top_level_statement'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.9.0/lib/irb.rb:507:in `eval_input'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.9.0/lib/irb.rb:494:in `block in run'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.9.0/lib/irb.rb:493:in `catch'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.9.0/lib/irb.rb:493:in `run'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.9.0/lib/irb.rb:395:in `start'
        from /home/HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.9.0/exe/irb:9:in `<top (required)>'
        from /home/HOME/.rbenv/versions/3.1.2/bin/irb:25:in `load'
        from /home/HOME/.rbenv/versions/3.1.2/bin/irb:25:in `<main>'

Result of irb_info

irb(main):001> irb_info
Ruby version: 3.1.2
IRB version: irb 1.9.0 (2023-11-11)
InputMethod: RelineInputMethod with Reline 0.4.0
Completion: Autocomplete, RegexpCompletor
RUBY_PLATFORM: x86_64-linux
LANG env: en_US.UTF-8
East Asian Ambiguous Width: 1

Terminal Emulator

Any terminal, including terminator, gnome-terminal, and vscodium terminal.

Setting Files

Are you using ~/.irbrc and ~/.inputrc?
No

@ima1zumi
Copy link
Member

Thank you for your report. This issue has been fixed by #764

@ahangarha
Copy link
Author

Oh!
Good.

Sorry for opening an issue. I first checked issues to see if similar issue has been reported. I didn't check PRs.

Bests

@tompng
Copy link
Member

tompng commented Nov 21, 2023

The fixed version IRB 1.9.1 is now released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants