Unverified Commit d745e8df authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo Committed by GitHub
Browse files

Merge pull request #4536 from tporadowski/antirez_unstable-cli-history

Always enable command history in redis-cli run on a TTY
parents 398b2084 77653ebe
...@@ -1386,8 +1386,9 @@ static void repl(void) { ...@@ -1386,8 +1386,9 @@ static void repl(void) {
/* Only use history and load the rc file when stdin is a tty. */ /* Only use history and load the rc file when stdin is a tty. */
if (isatty(fileno(stdin))) { if (isatty(fileno(stdin))) {
historyfile = getDotfilePath(REDIS_CLI_HISTFILE_ENV,REDIS_CLI_HISTFILE_DEFAULT); historyfile = getDotfilePath(REDIS_CLI_HISTFILE_ENV,REDIS_CLI_HISTFILE_DEFAULT);
if (historyfile != NULL) { //keep in-memory history always regardless if history file can be determined
history = 1; history = 1;
if (historyfile != NULL) {
linenoiseHistoryLoad(historyfile); linenoiseHistoryLoad(historyfile);
} }
cliLoadPreferences(); cliLoadPreferences();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment