Skip to content

Conversation

tompng
Copy link
Member

@tompng tompng commented Jan 26, 2025

Require readline may fail because it is a bundled gem in 3.5.0.dev.

Require readline may fail because it is a bundled gem in 3.5.0.dev.
@hsbt hsbt mentioned this pull request Jan 27, 2025
const_set(:Readline, ::Readline)
rescue LoadError
const_set(:Readline, ::Reline)
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds ReadlineInputMethod::Readline = ::Readline or ::Reline
because we don't want to pollute the top level by adding constant ::Readline when require 'readline' fails.

@tompng tompng merged commit 1ca7472 into ruby:master Jan 27, 2025
33 checks passed
@tompng
Copy link
Member Author

tompng commented Jan 27, 2025

To use GNU readline, now we need to add both gem 'readline' and gem 'readline-ext' to Gemfile.

Maybe we can require "readline.#{RbConfig::CONFIG['DLEXT']}" instead of 'readline' (https://github.com/ruby/readline/blob/master/lib/readline.rb)
Then users only need to add readline-ext to Gemfile just as it has been before.

@tompng tompng deleted the readline_bundled_gem branch January 27, 2025 14:01
@st0012
Copy link
Member

st0012 commented Jan 27, 2025

Is there any feature that readline does better than reline? Does it make sense to still allow both types of input methods going forward 🤔

@tompng
Copy link
Member Author

tompng commented Jan 27, 2025

I didn't thought of that. Maybe it's time to use Reline also in "--singleline", "--readline", "--legacy" mode.

(Off topic: irb --readline was useful for me to check the difference between Reline and Readline while developing Reline)

@tompng tompng added the bug Something isn't working label Apr 3, 2025
@tompng tompng mentioned this pull request Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants