Down arrow adds current line to history and shows empty line

This commit is contained in:
James Booth
2013-07-13 22:59:42 +01:00
parent 907beb55f6
commit 1d05a70473
3 changed files with 11 additions and 3 deletions

View File

@@ -146,6 +146,10 @@ history_next(History history, char *item)
return NULL;
}
if (g_list_next(history->session.sess_curr) == NULL) {
return NULL;
}
char *copied = "";
if (item != NULL) {
copied = strdup(item);

View File

@@ -490,6 +490,10 @@ _handle_edit(int result, const wint_t ch, char *input, int *size)
next = cmd_history_next(input, size);
if (next) {
inp_replace_input(input, next, size);
} else if (*size != 0) {
input[*size] = '\0';
cmd_history_append(input);
inp_replace_input(input, "", size);
}
return 1;