Project

General

Profile

Actions

Bug #14918

closed

Use Reline for fallback of ext/readline

Added by aycabta (aycabta .) over 5 years ago. Updated about 4 years ago.

Status:
Closed
Target version:
-
[ruby-core:87973]

Description

Ruby loses readline standard library when the system doesn't have libreadline during Ruby installation, At https://bugs.ruby-lang.org/issues/11084, @hsbt (Hiroshi SHIBATA) 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) Screen Shot 2019-12-25 at 11.47.25 AM.png josh.cheek (Josh Cheek), 12/25/2019 05:47 PM
Actions #1

Updated by aycabta (aycabta .) over 5 years ago

  • Tracker changed from Bug to Feature
  • Backport deleted (2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN)

Updated by naruse (Yui NARUSE) almost 5 years ago

  • Status changed from Open to Closed
  • Assignee set to aycabta (aycabta .)

r67645 introduces this feature.

Updated by josh.cheek (Josh Cheek) about 4 years ago

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 (Hiroshi SHIBATA) 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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0