diff --git a/cowterm.c b/cowterm.c index 2aaca80..b9f8014 100644 --- a/cowterm.c +++ b/cowterm.c @@ -767,15 +767,23 @@ static void key_press_cb(XKeyEvent *event, void *data) { } if (keysym == XK_Return || keysym == XK_KP_Enter) { - write(*master, "\r", 1); + write(*master, "\r", 1); // Shell handles return } else if (keysym == XK_BackSpace) { - write(*master, "\b", 1); + write(*master, "\b", 1); // Shell handles backspace } else if (keysym == XK_Left) { write(*master, "\033[D", 3); needs_refresh = 1; } else if (keysym == XK_Right) { write(*master, "\033[C", 3); needs_refresh = 1; + } else if (keysym == XK_Up) { // Go up through history + write(*master, "\033[A", 3); + needs_refresh = 1; + } else if (keysym == XK_Down) { // Go down through history + write(*master, "\033[B", 3); + needs_refresh = 1; + } else if (keysym == XK_Tab) { + write(*master, "\t", 1); // Shell handles autocomplete } else if (len > 0) { write(*master, buf, len); }