When I press AltUp,
A printed to terminal screen. Same thing happened when I pressed AltDown but
B is printed instead.
Other characters that I realized;
D and AltRight =
What is the purpose of these commands?
Depending on how the terminal is configured, typing Alt+Key is like typing the Esc and Key keys in sequence, so it sends the ESC character (aka
Upon pressing Up, most terminal emulators send either the three characters
The first one does correspond to the escape sequence which when output to the terminal, move the cursor up. If you do:
You'll see that the arrow keys do move the cursor around.
When an application like
Now, for Alt-Up, some terminals like
Those will typically send
When sent to the terminal, that sequence will also move the cursor up (the second parameter (3) is ignored). There's no corresponding keypad key, so it's the same sequence sent upon Alt-Up in or out of application keypad mode.
Now whether it's
They will try their best to interpret that sequence.
Many applications like
For instance, in
Those are to search the history backward and forward for command lines that start like the current one up to the current position of the cursor which is quite handy to recall previous commands.
You can use Crtl+v to return input codes of your keyboard. If you do that for arrow keys, you will get
And add a line:
Instead text you can pass a bindable command from http://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html#Bindable-Readline-Commands like
to have same effect like Crtl+u (delete line).
More information here: http://cnswww.cns.cwru.edu/php/chet/readline/readline.html