GNU Readline
lastmod 2024-10-07created 2024-10-071 edits
GNU readline is a library that handles line editing and input history in command-line interfaces. It is part of the GNU Project.
GNU readline supports features such as input autocompletion, cursor movement, cut, copy, and paste, and is used in command-line interactive software such as Bash.
bind
The bind command is used to manage key bindings and settings in programs that use the GNU Readline library (mainly the Bash shell). With the bind command, you can view or change Readline settings in the current session.
Show all current key bindings
Check a specific key binding
You can check the key bindings for a specific command.
For example, to check which keys are assigned to the beginning-of-line command:
Add a new key binding
You can add new key bindings or change existing ones.
Apply a .inputrc file
Use this when you want modified .inputrc settings to take effect in the current session right away.
Custom commands
You can also map custom commands to specific key presses. For example, you can make Ctrl + x output "Hello World!".
With this, pressing Ctrl + x types "Hello World" into the shell and executes it (\C-m means Enter).
Setting variables
You can also set variables used by Readline.