Readline supports both Emacs and vi editing modes, which determine how keyboard input is interpreted as editor commands. See Editor war#Differences between vi and Emacs.
Emacs keyboard shortcuts
Emacs editing mode key bindings are taken from the text editor Emacs. On some systems, must be used instead of, because the shortcut conflicts with another shortcut. For example, pressing in Xfce's terminal emulator window does not move the cursor forward one word, but activates "File" in the menu of the terminal window, unless that is disabled in the emulator's settings.
: Autocompletes from the cursor position.
: Moves the cursor to the line start.
: Moves the cursor back one character.
: Sends the signal SIGINT to the current task, which aborts and closes it.
* Sends an EOF marker, which closes the current shell.
* If there is text on the current line, deletes the current character.
: Clears the line content after the cursor and copies it into the clipboard.
: Clears the screen content.
: recalls the next command.
: Executes the found command from history, and fetch the next line relative to the current line from the history for editing.
: recalls the prior command.
: recalls the last command including the specified character. A second recalls the next anterior command that corresponds to the search
: Go back to the next more recent command of the research. If you changed that XOFF setting, use to return.
: Transpose the previous two characters.
: Clears the line content before the cursor and copies it into the clipboard.
: If the next input is also a control sequence, type it literally
: Clears the word before the cursor and copies it into the clipboard.
: Edits the current line in the $EDITOR program, or vi if undefined.
: Read in the contents of the inputrc file, and incorporate any bindings or variable assignments found there.
: Incremental undo, separately remembered for each line.
: Display version information about the current instance of Bash.
: Alternates the cursor with its old position..
: adds the clipboard content from the cursor position.
: Sends the signal SIGTSTP to the current task, which suspends it. To execute it in background one can enter bg. To bring it back from background or suspension fg can be issued.
: Incremental undo, separately remembered for each line.
: moves the cursor backward one word.
: Capitalizes the character under the cursor and moves to the end of the word.
: Cuts the word after the cursor.
: moves the cursor forward one word.
: Lowers the case of every character from the cursor's position to the end of the current word.
: Cancels the changes and puts back the line as it was in the history.
: Capitalizes every character from the cursor's position to the end of the current word.
: Insert the last argument to the previous command.
Choice of the GPL as GNU Readline's license
GNU Readline is notable for being a free software library which is licensed under the GNU General Public License. Free software libraries are far more often licensed under the GNU Lesser General Public License, for example, the GNU C Library, GNU gettext and FLTK. A developer of an application who chooses to link to an LGPL licensed library can use any license for the application. But linking to a GPL licensed library such as Readline requires the entire combined resulting application to be licensed under the GPL when distributed, to comply with section 5 of the GPL. This licensing was chosen by the FSF on the hopes that it would encourage software to switch to the GPL. An important example of an application changing its licensing to comply with the copyleft conditions of GNU Readline is CLISP, an implementation of Common Lisp. Originally released in 1987, it changed to the GPL license in 1992, after an email exchange between one of CLISP's original authors, Bruno Haible, and Richard Stallman, in which Stallman argued that the linking of readline in CLISP meant that Haible was required to re-license CLISP under the GPL if he wished to distribute the implementation of CLISP which used readline. Another response has been to not use this in some projects, making text input use the primitive Unix terminal driver for editing.
Alternative libraries
Alternative libraries have been created with other licenses so they can be used by software projects which want to implement command line editing functionality, but be released with a non-GPL license.
Many BSD systems have a BSD-licensedlibedit. MariaDB and PHP allow for the user to select at build time whether to link with GNU Readline or with libedit. macOS's libreadline is actually a shim over libedit, an arrangement known as editline.
linenoise is a tiny C library that provides line editing functions.
Haskeline is a readline-like library for Haskell. It is mainly written for the Glasgow Haskell Compiler, but is available to other Haskell projects which need line-editing services as well.
Sample code
The following code is in C and must be linked against the readline library by passing a -lreadline flag to the compiler: