From 77653ebe8a7dc2a673364711f31ff8736f80832c Mon Sep 17 00:00:00 2001 From: Tomasz Poradowski Date: Wed, 13 Dec 2017 23:49:41 +0100 Subject: [PATCH] always enable command history in redis-cli - when redis-cli is running in a TTY - always enable command history buffering, regardless if history file path can be successfully determined --- src/redis-cli.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/redis-cli.c b/src/redis-cli.c index 1f80bc61..372d02d9 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -1386,8 +1386,9 @@ static void repl(void) { /* Only use history and load the rc file when stdin is a tty. */ if (isatty(fileno(stdin))) { historyfile = getDotfilePath(REDIS_CLI_HISTFILE_ENV,REDIS_CLI_HISTFILE_DEFAULT); + //keep in-memory history always regardless if history file can be determined + history = 1; if (historyfile != NULL) { - history = 1; linenoiseHistoryLoad(historyfile); } cliLoadPreferences();