editor runs on terminal emulators, handling user input. • Examples: GNU Readline, libedit, Reline • Reline is compatible with GNU Readline and libedit. • Ruby’s default gem (default before Ruby 3.3, bundled gem from Ruby 3.4). 13 Although not a common term, ‘command line editor’ is used here because there is no general term for software like GNU Readline.
Editing commands • Con fi gurable variables • and more • Issues are occasionally reported about functionalities available in Readline but missing in Reline • Indicating user interest in these features Reline is Compatible with GNU Readline 23
If readline-ext is unavailable, require 'readline' will automatically use Reline. [1][2] • Eliminates installation issues with GNU Readline during Ruby builds. • Increased need for Reline's compatibility features. • Users may unknowingly switch dependency from readline-ext to Reline. require 'readline' loads Reline if missing readline-ext 24
of readline-ext. • Hope that users switch to Reline without noticing, ensuring a seamless transition. • Aim for Reline to become the chosen command line editor for users considering alternatives. • Add initial support for Reline on Ruby 3.3 #2298 · pry/pry https:// github.com/pry/pry/pull/2298 25
GNU Readline and Reline • ~/.inputrc or INPUTRC=path/to/ fi le • Con fi gurable options: • Con fi gurable variables • Editing commands • Key bindings • Set editing mode (emacs or vi) 29
line editor • For example, in Emacs mode, "\C-a" moves the cursor to the beginning of the line • In Vi mode, there are di ff erent bindings for command mode and insert mode • Customization is possible through .inputrc • Some settings written in .inputrc may not work with Reline 32
fi gurable items were mentioned in .inputrc • Includes commented-out entries • For items with default key bindings set, the presence in .inputrc indicates usage • Total fi les examined: 6600 35
Typing "abc" and then undoing reverts it to "ab". • The unit of undo depends on the editor: • GNU Readline likely uses keystroke timing. • Zsh Line Editor considers each input as one unit. • Reline treats each input as one unit. 58
GNU Readline and libedit. • It provides line-editing features and is extensible in Ruby. • require "readline-ext" loads Reline if readline-ext is missing. • For feature requests or bug reports, feel free to post on the ruby/reline repo.