diff --git a/src/redis-cli.c b/src/redis-cli.c index bff92d268..b91d0c2fb 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();