Skip to content
Advertisement

inputrc file cannot be loaded [closed]

I just figured out we can create a ~/.inputrc file to define keyboard mappings. But I don’t know how to load it. I tried to source it but I get a ‘set Syntax Error’ immediately. I copied the ~/.inputrc file from here: http://www.linuxfromscratch.org/lfs/view/6.2/chapter07/inputrc.html

It mentions that it is loaded using Readline. What does that mean?

Advertisement

Answer

Readline is one of several possible “keyboard input handling frontends” that a program might use. A program might also use none (other than the usual stdio handling done by libc).

As mentioned, .inputrc is used by readline, so it will only affect programs that use readline. Bash is such a program, so it will use .inputrc indirectly, but it is not a file that you will source like files as .bashrc, and the syntax is not related at all. The .inputrc file is only loaded (indirectly though the readline library) by the program at startup. From the documentation:

When a program which uses the Readline library starts up, the init file is read, and the key bindings are set.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement