6

I've seen a lot of online resources mention several compound shortcuts beginning with Ctrl+X :

Ctrlx Ctrle : Edits the current line in the $EDITOR program, or vi if undefined.

Ctrlx Ctrlr : Read in the contents of the inputrc file, and incorporate any bindings or variable assignments found there.

Ctrlx Ctrlu : Incremental undo, separately remembered for each line.

Ctrlx Ctrlv : Display version information about the current instance of bash.

Ctrlx Ctrlx : Alternates the cursor with its old position. (C-x, because x has a crossing shape).

But I cannot find a single official documentation source that would list all of the possible Ctrl+X+<something> combinations, and I don't even know what would be the tool to look up the man of: is is bash? readline? xterm?

So what exactly handles these compound Ctrl+X+<something> shortcuts in Linux terminals?

2 Answers 2

4

The characters handled directly by the linux terminal can be listed with stty -a. Anything else is handled by the application you are running, and a list of the key sequences should be in the documentation for that application.

The application most likely involved here is your shell. Most modern shells (including bash, zsh, others) either use the readline library or implement line editing themselves. The readline library and most of the shells that do this without readline derive their key sequences from the emacs editor (although vi bindings may also be available), and in particularly ones that start with ctrl-x are from emacs, and the C-x notation in particular (for ctrl-x) is from the emacs documenatation. (Just for clarification -- emacs doesn't do this unless you are running emacs. The applications just duplicated the functionality for their own use.)

3

The thing that handles the Ctrl+X+<something> and much more is the 'readline' library and the documentation that covers it can be found in the GNU bash man.

The Ctrl+<something> shortcuts are somewhat cryptically described as C-<something> due to the fact that Control key may be named differently depending on your machine.

See also /etc/inputrc and possibly /etc/inputrc.keys.

You must log in to answer this question.

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