Binding to `exit` command causes `TypeError`
Open
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 311
- Forks
- 99
- Avg merge
- 6d 4h
- Merged PRs (30d)
- 1
Description
inputrc:
Control-d: exit
❱ ./bin/console
irb(main):001> ^D
RELINE_SRCDIR/lib/reline/line_editor.rb:975:in 'Kernel#exit': no implicit conversion of String into Integer (TypeError)
from RELINE_SRCDIR/lib/reline/line_editor.rb:975:in 'Method#call'
from RELINE_SRCDIR/lib/reline/line_editor.rb:975:in 'Reline::LineEditor#wrap_method_call'
from RELINE_SRCDIR/lib/reline/line_editor.rb:941:in 'Reline::LineEditor#run_for_operators'
from RELINE_SRCDIR/lib/reline/line_editor.rb:1001:in 'Reline::LineEditor#process_key'
from RELINE_SRCDIR/lib/reline/line_editor.rb:1027:in 'Reline::LineEditor#input_key'
from RELINE_SRCDIR/lib/reline/line_editor.rb:1005:in 'Reline::LineEditor#update'
<omitted>
I didn't follow the whole call chain, but I'm guessing key.method_symbol == :exit and wrap_method_call simply grabs the method from top-level Kernel and calls it with a string parameter, causing the TypeError exception.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect lib/reline/line_editor.rb around wrap_method_call and the referenced method lookup and call sites. Reproduce the inputrc binding with Control-d and verify that binding it to exit no longer raises TypeError and performs the expected command behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100