Issue #15989 has been reported by maciej.mensfeld (Maciej Mensfeld).

----------------------------------------
Bug #15989: irb-1.1.0.pre.1 crashes on using arrow up, home and delete
https://bugs.ruby-lang.org/issues/15989

* Author: maciej.mensfeld (Maciej Mensfeld)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-07-04T09:54:50Z master 265b9a0edf) [x86_64-linux] last_commit=Parse key sequence more strictly
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
When I do this:

1. Define empty string `''`
2. Press arrow up
3. Press Home
4. Press Delete to remove first `'`
5. irb crashes

I get following exception:

```
	33: from ../install/bin/irb:23:in `<main>'
	32: from ../install/bin/irb:23:in `load'
	31: from /workdir/install/lib/ruby/gems/2.7.0/gems/irb-1.1.0.pre.1/exe/irb:11:in `<top (required)>'
	30: from /workdir/install/lib/ruby/2.7.0/irb.rb:389:in `start'
	29: from /workdir/install/lib/ruby/2.7.0/irb.rb:431:in `run'
	28: from /workdir/install/lib/ruby/2.7.0/irb.rb:431:in `catch'
	27: from /workdir/install/lib/ruby/2.7.0/irb.rb:432:in `block in run'
	26: from /workdir/install/lib/ruby/2.7.0/irb.rb:496:in `eval_input'
	25: from /workdir/install/lib/ruby/2.7.0/irb/ruby-lex.rb:125:in `each_top_level_statement'
	24: from /workdir/install/lib/ruby/2.7.0/irb/ruby-lex.rb:125:in `catch'
	23: from /workdir/install/lib/ruby/2.7.0/irb/ruby-lex.rb:126:in `block in each_top_level_statement'
	22: from /workdir/install/lib/ruby/2.7.0/irb/ruby-lex.rb:126:in `loop'
	21: from /workdir/install/lib/ruby/2.7.0/irb/ruby-lex.rb:129:in `block (2 levels) in each_top_level_statement'
	20: from /workdir/install/lib/ruby/2.7.0/irb/ruby-lex.rb:157:in `lex'
	19: from /workdir/install/lib/ruby/2.7.0/irb.rb:477:in `block in eval_input'
	18: from /workdir/install/lib/ruby/2.7.0/irb.rb:654:in `signal_status'
	17: from /workdir/install/lib/ruby/2.7.0/irb.rb:478:in `block (2 levels) in eval_input'
	16: from /workdir/install/lib/ruby/2.7.0/irb/input-method.rb:259:in `gets'
	15: from /workdir/install/lib/ruby/2.7.0/reline.rb:296:in `readmultiline'
	14: from /workdir/install/lib/ruby/2.7.0/reline.rb:357:in `inner_readline'
	13: from /workdir/install/lib/ruby/2.7.0/reline.rb:357:in `loop'
	12: from /workdir/install/lib/ruby/2.7.0/reline.rb:358:in `block in inner_readline'
	11: from /workdir/install/lib/ruby/2.7.0/reline.rb:387:in `read_io'
	10: from /workdir/install/lib/ruby/2.7.0/reline.rb:387:in `loop'
	 9: from /workdir/install/lib/ruby/2.7.0/reline.rb:393:in `block in read_io'
	 8: from /workdir/install/lib/ruby/2.7.0/reline.rb:359:in `block (2 levels) in inner_readline'
	 7: from /workdir/install/lib/ruby/2.7.0/reline.rb:359:in `each'
	 6: from /workdir/install/lib/ruby/2.7.0/reline.rb:360:in `block (3 levels) in inner_readline'
	 5: from /workdir/install/lib/ruby/2.7.0/reline/line_editor.rb:779:in `input_key'
	 4: from /workdir/install/lib/ruby/2.7.0/reline/line_editor.rb:675:in `process_key'
	 3: from /workdir/install/lib/ruby/2.7.0/reline/line_editor.rb:675:in `call'
	 2: from /workdir/install/lib/ruby/2.7.0/reline/line_editor.rb:999:in `key_delete'
	 1: from /workdir/install/lib/ruby/2.7.0/reline/line_editor.rb:1734:in `ed_delete_next_char'
/workdir/install/lib/ruby/2.7.0/reline/line_editor.rb:1734:in `-': nil can't be coerced into Integer (TypeError)
```

attached a demo made with `asciinema`. Play (or cat as it's a text file) with: `asciinema play error.dat`

---Files--------------------------------
asciinema - error.dat (5.21 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>