diff options
author | Tomasz Poradowski <tomasz@poradowski.net> | 2017-12-13 23:49:41 +0100 |
---|---|---|
committer | Tomasz Poradowski <tomasz@poradowski.net> | 2017-12-13 23:49:41 +0100 |
commit | 77653ebe8a7dc2a673364711f31ff8736f80832c (patch) | |
tree | f8461b3c0c4f0f4d778224f7c09b8e6694ada4c4 | |
parent | de276b6a439179b3cd0c94df82729cae8ab1cb9a (diff) | |
download | redis-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.c | 3 |
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(); |