diff --git a/lib/reline.rb b/lib/reline.rb index f0060f5c9c..ff96589ca6 100644 --- a/lib/reline.rb +++ b/lib/reline.rb @@ -335,7 +335,7 @@ def readline(prompt = '', add_hist = false) end end - unless config.test_mode + unless config.test_mode or config.loaded? config.read config.reset_default_key_bindings io_gate.set_default_key_bindings(config) diff --git a/lib/reline/config.rb b/lib/reline/config.rb index bec1ca178d..58bf09ac02 100644 --- a/lib/reline/config.rb +++ b/lib/reline/config.rb @@ -69,6 +69,7 @@ def initialize @test_mode = false @autocompletion = false @convert_meta = true if seven_bit_encoding?(Reline::IOGate.encoding) + @loaded = false end def reset @@ -98,6 +99,10 @@ def keymap @key_actors[@keymap_label] end + def loaded? + @loaded + end + def inputrc_path case ENV['INPUTRC'] when nil, '' @@ -141,6 +146,7 @@ def read(file = nil) end read_lines(lines, file) + @loaded = true self rescue InvalidInputrc => e warn e.message