summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSkyperTHC <5938498+SkyperTHC@users.noreply.github.com>2023-03-03 08:28:55 +0000
committerGitHub <noreply@github.com>2023-03-03 10:28:55 +0200
commitbb57d4ec7559fb5a2cd83b31ffeea2dc73e89ab0 (patch)
tree998c045b9f899e605a7a719a480ef62d202c2bf0 /src
parent9d336ac398d3a28f6e5e76f1b3b110bab949bcc5 (diff)
downloadredis-bb57d4ec7559fb5a2cd83b31ffeea2dc73e89ab0.tar.gz
Dont COMMANDS DOCS if not TTY (not interactive) (#11850)
Avoiding initializing the interactive help and the excessive call to the COMMAND command when using redis-cli with pipe. e.g. ``` echo PING | redis-cli ```
Diffstat (limited to 'src')
-rw-r--r--src/redis-cli.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/redis-cli.c b/src/redis-cli.c
index b9d84c6d9..4e99e1099 100644
--- a/src/redis-cli.c
+++ b/src/redis-cli.c
@@ -2621,7 +2621,7 @@ static void repl(void) {
/* There is no need to initialize redis HELP when we are in lua debugger mode.
* It has its own HELP and commands (COMMAND or COMMAND DOCS will fail and got nothing).
* We will initialize the redis HELP after the Lua debugging session ended.*/
- if (!config.eval_ldb) {
+ if ((!config.eval_ldb) && isatty(fileno(stdin))) {
/* Initialize the help using the results of the COMMAND command. */
cliInitHelp();
}