mirror of
https://github.com/tstack/lnav
synced 2024-11-17 15:29:40 +00:00
[readline] dedupe history
This commit is contained in:
parent
275724e912
commit
7e8118513e
@ -89,7 +89,6 @@ static void sigterm(int sig)
|
||||
static void line_ready_tramp(char *line)
|
||||
{
|
||||
child_this->line_ready(line);
|
||||
add_history(line);
|
||||
got_line = 1;
|
||||
rl_callback_handler_remove();
|
||||
}
|
||||
@ -497,6 +496,17 @@ void readline_curses::line_ready(const char *line)
|
||||
perror("line_ready: write failed");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
{
|
||||
HIST_ENTRY *entry;
|
||||
|
||||
if (line[0] != '\0' && (
|
||||
history_length == 0 ||
|
||||
(entry = history_get(history_base + history_length - 1)) == NULL ||
|
||||
strcmp(entry->line, line) != 0)) {
|
||||
add_history(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void readline_curses::check_fd_set(fd_set &ready_rfds)
|
||||
|
Loading…
Reference in New Issue
Block a user