Skip to content

Commit 5129ca3

Browse files
shugomatzbot
authored andcommitted
[ruby/rdoc] Delay require "readline" in case the terminal is in raw mode
1 parent 739ad81 commit 5129ca3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/rdoc/ri/driver.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# frozen_string_literal: true
22
require 'optparse'
33

4-
begin
5-
require 'readline'
6-
rescue LoadError
7-
end
8-
94
require_relative '../../rdoc'
105

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

1077+
begin
1078+
require 'readline'
1079+
rescue LoadError
1080+
end
10821081
if defined? Readline then
10831082
Readline.completion_proc = method :complete
10841083
puts "You can use tab to autocomplete."

0 commit comments

Comments
 (0)