You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Launch irb (1.2.6) with --readline option.
Execute the following:
a='§'
Expected output:
=>"§"
Actual output:
Traceback (most recent call last):
7: from /Users/sergey.stoyanovsky/.rvm/rubies/ruby-2.7.5/bin/irb:23:in `<main>'
6: from /Users/sergey.stoyanovsky/.rvm/rubies/ruby-2.7.5/bin/irb:23:in `load'
5: from /Users/sergey.stoyanovsky/.rvm/rubies/ruby-2.7.5/lib/ruby/gems/2.7.0/gems/irb-1.2.6/exe/irb:11:in `<top (required)>'
4: from /Users/sergey.stoyanovsky/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/reline/unicode.rb:99:in `calculate_width'
3: from /Users/sergey.stoyanovsky/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/reline/unicode.rb:99:in `scan'
2: from /Users/sergey.stoyanovsky/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/reline/unicode.rb:108:in `block in calculate_width'
1: from /Users/sergey.stoyanovsky/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/reline/unicode.rb:108:in `+'
TypeError (nil can't be coerced into Integer)
I suppose that output length calculation causes this since running the same assignment command after executing IRB.CurrentContext.omit_on_assignment = false before it produces proper output with no errors.
The following chain IRB::Irb#output_value -> Reline::Unicode#calculate_width -> Reline::Unicode#get_mbchar_width -> Reline.ambiguous_width leads to the uninitialized instance var @ambiguous_width, hence nil can't be coerced into Integer.
Description
Launch
irb (1.2.6)
with--readline
option.Execute the following:
Expected output:
Actual output:
I suppose that output length calculation causes this since running the same assignment command after executing
IRB.CurrentContext.omit_on_assignment = false
before it produces proper output with no errors.The following chain
IRB::Irb#output_value
->Reline::Unicode#calculate_width
->Reline::Unicode#get_mbchar_width
->Reline.ambiguous_width
leads to the uninitialized instance var@ambiguous_width
, hence nil can't be coerced into Integer.Result of irb_info
Terminal Emulator
zsh
Setting Files
No
~/.irbrc
.My
/Users/sergey.stoyanovsky/.rvm/rubies/ruby-2.7.5/.irbrc
:The text was updated successfully, but these errors were encountered: