Skip to content

Commit

Permalink
Delay require "readline" in case the terminal is in raw mode
Browse files Browse the repository at this point in the history
  • Loading branch information
shugo authored and hsbt committed Oct 27, 2022
1 parent 2300cbe commit 45259f9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/rdoc/ri/driver.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# frozen_string_literal: true
require 'optparse'

begin
require 'readline'
rescue LoadError
end

require_relative '../../rdoc'

require_relative 'formatter' # For RubyGems backwards compatibility
Expand Down Expand Up @@ -1079,6 +1074,10 @@ def formatter(io)
def interactive
puts "\nEnter the method name you want to look up."

begin
require 'readline'
rescue LoadError
end
if defined? Readline then
Readline.completion_proc = method :complete
puts "You can use tab to autocomplete."
Expand Down

0 comments on commit 45259f9

Please sign in to comment.