2

I created ~/.inputrc and cannot see any of its effects at the bash readline.

$ bind -f ~/.inputrc does not show error nor load the file.

$INPUTRC is unset and if I export INPUTRC=~/.inputrc in ~/.bashrc and restart bash, then nothing changes.

Search for inputrc in the output of $ strace bash verifies read happened:

openat(AT_FDCWD, "/home/me/.inputrc", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0664, st_size=1900, ...}) = 0
read(3, "# ~/.inputrc\n#\n# bash configurat"..., 1900) = 1900
close(3)                                = 0

Output of $ bind -v | grep completion-ignore-case which my .inputrc turns on, but bind shows that it remains off:

set completion-ignore-case off

Output of $ bind -p | grep -e C-q should show that my .inputrc redefines control-q, but bind shows:

"\C-q": quoted-insert

My inputrc file:

# ~/.inputrc
#
# bash configuration file
# See readline(3readline) and `info rluserman' (readline llibrary) for more information.
#
# set VARIABLE VALUE
# KEY-NAME: "MACRO"
# KEY-NAME: COMMAND
#
# Note: Keystrokes like \015 or \C-m (return) may be part of MACRO
#
# \C-KEY = Control-KEY (KEY should be lower case)
# \M-KEY = Alternate-KEY (KEY should be lower case)
# \e = escape (sent by keyboard when using alternate key)
# \\ = backslash
# \" = double quote
# \' = single quote
# \a = altert bell
# \b = backspace
# \d = delete
# \f = form feed
# \n = newline (linux: line feed \x0A)
# \r = return
# \t = tab
# \v = vertical tab
# \ooo = 8 bit octal code
# \xHH = 8 bit hex codep
#
# $if
# $else
# $endif
# $include

###############
# stuff from /etc/inputrc
###############

# Be 8 bit clean.
set input-meta on
set output-meta on

# arrow key bindings
"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[C": forward-char
"\e[D": backward-char

# allow the use of the Home/End keys
"\e[1~": beginning-of-line
"\e[4~": end-of-line

# allow the use of the Delete/Insert keys
"\e[3~": delete-char
"\e[2~": quoted-insert

# alternate mappings for "page up" and "page down" to search the history
# "\e[5~": history-search-backward
# "\e[6~": history-search-forward

# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word

$if term=rxvt
"\e[7~": beginning-of-line
"\e[8~": end-of-line
"\eOc": forward-word
"\eOd": backward-word

###############
# my stuff
###############

set colored-stats on
set completion-ignore-case on
set completion-prefix-display-length 3
set mark-symlinked-directories on
set show-all-if-ambiguous on
set show-all-if-unmodified on
set visible-stats on

# Convert line to $"(..)"
"\C-q": "\C-a\"$(\C-e)\"\C-a"
1
  • 3
    You seem to be using $if in the file, but I see no $endif.
    – Kusalananda
    Dec 16, 2020 at 14:07

1 Answer 1

0

My .inputrc file contained an $if but lacked an $endif which caused the contents to be ignored.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .