summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/reline.rb2
-rw-r--r--lib/reline/config.rb6
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/reline.rb b/lib/reline.rb
index 0a266b9c58..7774572f92 100644
--- a/lib/reline.rb
+++ b/lib/reline.rb
@@ -338,7 +338,7 @@ module Reline
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 @@ class Reline::Config
@test_mode = false
@autocompletion = false
@convert_meta = true if seven_bit_encoding?(Reline::IOGate.encoding)
+ @loaded = false
end
def reset
@@ -98,6 +99,10 @@ class Reline::Config
@key_actors[@keymap_label]
end
+ def loaded?
+ @loaded
+ end
+
def inputrc_path
case ENV['INPUTRC']
when nil, ''
@@ -141,6 +146,7 @@ class Reline::Config
end
read_lines(lines, file)
+ @loaded = true
self
rescue InvalidInputrc => e
warn e.message