Linux

Where Is the Readline inputrc File?

GNU Readline reads ~/.inputrc on Linux for keybindings and editing modes across bash, gdb, psql, and anything else linked against it.

Last updated

Readline powers line editing in half the terminal world from one config file. ~/.inputrc sets editing mode, keybindings, completion behavior, and bell style globally. System defaults in /etc/inputrc apply underneath for anything personal files skip.

One file explaining bash, gdb, and database shells together surprises people yearly. Changes need fresh processes since Readline loads at startup. Conditional blocks by program name keep shared bindings sane when tools disagree.

Where Readline stores this, by platform

Linux
~/.inputrc

Global Readline keybindings and modes for bash, gdb, psql, and friends. Reload by restarting programs. /etc/inputrc provides system defaults beneath.

Frequently asked questions

How do I get vi mode everywhere?

Add set editing-mode vi to ~/.inputrc then restart the programs, since Readline reads the file at startup only. Running shells need reopening too. Test in a fresh terminal before declaring victory.

How do I share keybindings across tools?

Bind them once in ~/.inputrc with Control or Meta sequences and every Readline program inherits them. Gdb, psql, python REPL, and bash share the file. Program specific $if blocks handle exceptions.

Notice an outdated path? Let us know.