-
Notifications
You must be signed in to change notification settings - Fork 143
Closed
Description
Description
IRB crashes when I type %ww, but I expect it doesn't crash.
Reproduce
- Launch
irbcommand from a shell- I launched
irbwithRUBYOPT='-I path/to/reline/lib -I path/to/irb/lib' irbto use the HEAD of them.
- I launched
- Type
%ww.- I can reproduce other alpha-numeric characters, such as
%aaor%11.
- I can reproduce other alpha-numeric characters, such as
- It crashes.
Sometimes it doesn't crash on %ww (double w), but it always crashes on %www (triple w).
The stacktrace is here
irb(main):001:0> %w/home/pocke/ghq/github.com/ruby/reline/lib/reline/unicode.rb:124:in `calculate_width': undefined method `encode' for nil:NilClass (NoMethodError)
from /home/pocke/ghq/github.com/ruby/reline/lib/reline/line_editor.rb:1316:in `calculate_width'
from /home/pocke/ghq/github.com/ruby/reline/lib/reline/line_editor.rb:126:in `check_multiline_prompt'
from /home/pocke/ghq/github.com/ruby/reline/lib/reline/line_editor.rb:365:in `rerender'
from /home/pocke/ghq/github.com/ruby/reline/lib/reline.rb:248:in `block (3 levels) in inner_readline'
from /home/pocke/ghq/github.com/ruby/reline/lib/reline.rb:246:in `each'
from /home/pocke/ghq/github.com/ruby/reline/lib/reline.rb:246:in `block (2 levels) in inner_readline'
from /home/pocke/ghq/github.com/ruby/reline/lib/reline.rb:330:in `block in read_io'
from /home/pocke/ghq/github.com/ruby/reline/lib/reline.rb:284:in `loop'
from /home/pocke/ghq/github.com/ruby/reline/lib/reline.rb:284:in `read_io'
from /home/pocke/ghq/github.com/ruby/reline/lib/reline.rb:245:in `block in inner_readline'
from /home/pocke/ghq/github.com/ruby/reline/lib/reline.rb:243:in `loop'
from /home/pocke/ghq/github.com/ruby/reline/lib/reline.rb:243:in `inner_readline'
from /home/pocke/ghq/github.com/ruby/reline/lib/reline.rb:175:in `readmultiline'
from /home/pocke/.rbenv/versions/trunk/lib/ruby/3.1.0/forwardable.rb:238:in `readmultiline'
from /home/pocke/.rbenv/versions/trunk/lib/ruby/3.1.0/forwardable.rb:238:in `readmultiline'
from /home/pocke/ghq/github.com/ruby/irb/lib/irb/input-method.rb:302:in `gets'
from /home/pocke/ghq/github.com/ruby/irb/lib/irb.rb:519:in `block (2 levels) in eval_input'
from /home/pocke/ghq/github.com/ruby/irb/lib/irb.rb:745:in `signal_status'
from /home/pocke/ghq/github.com/ruby/irb/lib/irb.rb:518:in `block in eval_input'
from /home/pocke/ghq/github.com/ruby/irb/lib/irb/ruby-lex.rb:203:in `lex'
from /home/pocke/ghq/github.com/ruby/irb/lib/irb/ruby-lex.rb:175:in `block (2 levels) in each_top_level_statement'
from /home/pocke/ghq/github.com/ruby/irb/lib/irb/ruby-lex.rb:172:in `loop'
from /home/pocke/ghq/github.com/ruby/irb/lib/irb/ruby-lex.rb:172:in `block in each_top_level_statement'
from /home/pocke/ghq/github.com/ruby/irb/lib/irb/ruby-lex.rb:171:in `catch'
from /home/pocke/ghq/github.com/ruby/irb/lib/irb/ruby-lex.rb:171:in `each_top_level_statement'
from /home/pocke/ghq/github.com/ruby/irb/lib/irb.rb:537:in `eval_input'
from /home/pocke/ghq/github.com/ruby/irb/lib/irb.rb:472:in `block in run'
from /home/pocke/ghq/github.com/ruby/irb/lib/irb.rb:471:in `catch'
from /home/pocke/ghq/github.com/ruby/irb/lib/irb.rb:471:in `run'
from /home/pocke/ghq/github.com/ruby/irb/lib/irb.rb:400:in `start'
from /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/irb-1.3.0/exe/irb:11:in `<top (required)>'
from /home/pocke/.rbenv/versions/trunk/bin/irb:23:in `load'
from /home/pocke/.rbenv/versions/trunk/bin/irb:23:in `<main>'
Result of irb_info
irb(main):001:0> irb_info
=>
Ruby version: 3.1.0
IRB version: irb 1.3.0 (2020-12-25)
InputMethod: ReidlineInputMethod with Reline 0.2.0
.irbrc path: /home/pocke/.irbrc
I used the current HEAD of irb and reline.
88b6542
ruby/reline@9ec0304
I can reproduce it on Ruby v2.7.2 and v3.0.0 also.
Terminal Emulator
Sakura Terminal Emulator on Arch Linux.
Setting Files
Are you using ~/.irbrc and ~/.inputrc?
I use ~/.irbrc but I can reproduce it even if the irbrc is empty.
~/.inputrc doesn't exist.
Related ticket
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels