summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Poradowski <tomasz@poradowski.net>2017-12-13 23:49:41 +0100
committerTomasz Poradowski <tomasz@poradowski.net>2017-12-13 23:49:41 +0100
commit77653ebe8a7dc2a673364711f31ff8736f80832c (patch)
treef8461b3c0c4f0f4d778224f7c09b8e6694ada4c4
parentde276b6a439179b3cd0c94df82729cae8ab1cb9a (diff)
downloadredis-77653ebe8a7dc2a673364711f31ff8736f80832c.tar.gz
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
-rw-r--r--src/redis-cli.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/redis-cli.c b/src/redis-cli.c
index 1f80bc615..372d02d97 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();