[ruby-core:96473] [Ruby master Bug#14918] Use Reline for fallback of ext/readline
[email protected] Wed, 25 Dec 2019 18:12:02 +0000 (UTC)
| Newsgroups | gmane.comp.lang.ruby.core |
|---|---|
| Message-ID | <redmine.journal-83401.20191225181201.477ad664a475abeb@ruby-lang.org> |
Issue #14918 has been updated by josh.cheek (Josh Cheek).
Backport set to 2.5: UNKNOWN, 2.6: UNKNOWN
Tracker changed from Feature to Bug
File Screen Shot 2019-12-25 at 11.47.25 AM.png added
aycabta (aycabta .) wrote:
> Ruby loses readline standard library when the system doesn't have libreadline during Ruby installation, At https://bugs.ruby-lang.org/issues/11084, @hsbt proposed pure Ruby implementation. But I think that rb-readline is not good for Ruby standard library and I described it at http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/86213. The important reason for it personally is that rb-readline doesn't have vi mode.
>
> So I'm implementing Reline for a new standard library as GNU Readline and existing ext/readline compatible. I can maintain it.
> https://github.com/aycabta/reline
>
> I don't think that Reline should replace ext/readline fully, it's just for fallback. But it's important for Ruby.
Reline does not seem to support bracketed paste mode:
```
$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin18]
$ # has 2 lines of input
pbpaste
"abc"
.upcase
$ # readline respects bracketed paste mode, reads in both lines
ruby -r readline -e 'p Readline.readline "> "'
> "abc"
.upcase
"\"abc\"\n.upcase"
$ # reline does not support bracketed paste mode, reads them in as 2 separate lines
ruby -r reline -e '2.times { p Reline.readline "> " }'
> "abc"
"\"abc\""
> .upcase
".upcase"
$ cat ~/.inputrc | sed '/^$/q'
set enable-bracketed-paste on
set blink-matching-paren on
set colored-completion-prefix on
set colored-stats on
set keyseq-timeout 250
set show-all-if-ambiguous on
set visible-stats on
```
I also checked one of the other config options (blink-matching-paren) and it blinks with readline, but not reline. Makes me wonder if it isn't reading the ~/.inputrc file (it may be Mac specific).
Reporting it here as the Github project doesn't seem to have an issues section.
----------------------------------------
Bug #14918: Use Reline for fallback of ext/readline
https://bugs.ruby-lang.org/issues/14918#change-83401
* Author: aycabta (aycabta .)
* Status: Closed
* Priority: Normal
* Assignee: aycabta (aycabta .)
* Target version:
* ruby -v:
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Ruby loses readline standard library when the system doesn't have libreadline during Ruby installation, At https://bugs.ruby-lang.org/issues/11084, @hsbt proposed pure Ruby implementation. But I think that rb-readline is not good for Ruby standard library and I described it at http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/86213. The important reason for it personally is that rb-readline doesn't have vi mode.
So I'm implementing Reline for a new standard library as GNU Readline and existing ext/readline compatible. I can maintain it.
https://github.com/aycabta/reline
I don't think that Reline should replace ext/readline fully, it's just for fallback. But it's important for Ruby.
---Files--------------------------------
Screen Shot 2019-12-25 at 11.47.25 AM.png (83.4 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>