vte: implement editing keys

Implement the basic editing keys that are used by several applications. We
use the 7bit CSI sequence to avoid UTF8 issues. Otherwise, we would have
to encode the C1 CSI 0x9b as UTF8 character which is also a 2 byte
sequence.

Besides INSERT, DELETE, PAGEUP and PAGEDOWN an VT220 also had SELECT and
FIND keys which we do not implement as they are not present on modern
keyboards.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: implement cursor keys

In cursor-key-mode reset we send the normal CSI sequences, again encoded
with C0 codes as C1 codes are nonsense in UTF8. In cursor-key-mode set we
use the SS3 codes instead.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: add line-feed/new-line mode

In line-feed/new-line mode the NL/.. codes generate a CR *and* a NL.
Otherwise, they only generate CRs.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: handle KeyPad/NumPad keys

This adds handlers for all the special keys on numpads/keypads.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: handle F1-F20 correctly

F1-F4 are mapped to the keypad keys as these keys were not available on
VT220. F5 is special mapped and F6-F20 correspond to the same keys on the
keyboards for VT220.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: add ctrl+0-9 shortcuts

The VT220 defines some additional shortcuts to send escape codes with
ctrl+<num>. Implement these as aliases to the same well-defined shortcuts.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: use callback for outgoing messages

VTE now requires a new callback that is called when we want to send
messages to the pty etc. This is needed if we want to send messages as
responses to incoming data. Otherwise, we would have way too much overhead
assembling composed messages.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: answer with ACK to an ENQ enquiry

Other emulators might ignore this. However, the easiest way to answer to
an enquiry is probably ACK.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: remove kmscon_console_backspace()

This function is not needed at all. Instead, we should simply move one
character to the left on incoming backspace. There is no need to handle
auto-wrap on backspace.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: show reversed question mark on SUB

When receiving SUB we now correctly write a reversed question mark into
the buffer. We still cancel the ongoing escape sequence, this worked even
without this patch.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: explicitely ignore DEL

Add dummy to do_execute() which explicitely ignores the DEL input.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: implement IND and RI

IND and RI both either move one row up or down and perform scroll up/down
if required.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: implement NEL

NEL is a shortcut for newline independent of the line-feed/new-line mode.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
vte: implement DECSCL 'p' CSI

DECSCL is used to select compatibility modes. We do not support the VT100
compatibility mode explicitely or the VT220 mode, however, we always send
7-bit control characters and support escape sequences from both series so
we can safely ignore DECSCL.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>