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

Always enable command history in redis-cli run on a TTY
This commit is contained in:
Salvatore Sanfilippo 2017-12-14 22:14:45 +01:00 committed by GitHub
commit d745e8dfb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();