diff --git a/src/vte.c b/src/vte.c index 0c0b162..fe4f14d 100644 --- a/src/vte.c +++ b/src/vte.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "console.h" #include "input.h" @@ -142,6 +143,7 @@ int kmscon_vte_handle_keyboard(struct kmscon_vte *vte, const struct kmscon_input_event *ev, const char **u8, size_t *len) { kmscon_symbol_t sym; + int ret; if (ev->unicode != KMSCON_INPUT_INVALID) { kmscon_symbol_free_u8(vte->kbd_sym); @@ -150,6 +152,20 @@ int kmscon_vte_handle_keyboard(struct kmscon_vte *vte, *u8 = vte->kbd_sym; return KMSCON_VTE_SEND; } else { - return KMSCON_VTE_DROP; + ret = KMSCON_VTE_SEND; + + switch (ev->keysym) { + case XK_Return: + case XK_Linefeed: + case XK_KP_Enter: + *u8 = "\n"; + *len = 1; + break; + default: + ret = KMSCON_VTE_DROP; + break; + } + + return ret; } }