mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Prefer $INPUTRC over the default in the home
Closes: https://github.com/ruby/ruby/pull/2222
This commit is contained in:
parent
4fda39fc87
commit
a1e6e45341
1 changed files with 3 additions and 3 deletions
|
@ -3,7 +3,7 @@ require 'pathname'
|
||||||
class Reline::Config
|
class Reline::Config
|
||||||
attr_reader :test_mode
|
attr_reader :test_mode
|
||||||
|
|
||||||
DEFAULT_PATH = Pathname.new(Dir.home).join('.inputrc')
|
DEFAULT_PATH = '~/.inputrc'
|
||||||
|
|
||||||
VARIABLE_NAMES = %w{
|
VARIABLE_NAMES = %w{
|
||||||
bind-tty-special-chars
|
bind-tty-special-chars
|
||||||
|
@ -77,8 +77,8 @@ class Reline::Config
|
||||||
@key_actors[@keymap_label]
|
@key_actors[@keymap_label]
|
||||||
end
|
end
|
||||||
|
|
||||||
def read(file = DEFAULT_PATH)
|
def read(file = nil)
|
||||||
file = ENV['INPUTRC'] if ENV['INPUTRC']
|
file ||= File.expand_path(ENV['INPUTRC'] || DEFAULT_PATH)
|
||||||
begin
|
begin
|
||||||
if file.respond_to?(:readlines)
|
if file.respond_to?(:readlines)
|
||||||
lines = file.readlines
|
lines = file.readlines
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue