Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
d745e8df
Unverified
Commit
d745e8df
authored
Dec 14, 2017
by
Salvatore Sanfilippo
Committed by
GitHub
Dec 14, 2017
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
Changes
1
Show whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
d745e8df
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment