LINENOISE_HISTORY_PREV
l->history_index += (dir == LINENOISE_HISTORY_PREV) ? 1 : -1;
linenoiseEditHistoryNext(&l, LINENOISE_HISTORY_PREV);