summaryrefslogtreecommitdiff
path: root/src/redis-cli.c
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2010-08-04 18:16:39 +0200
committerPieter Noordhuis <pcnoordhuis@gmail.com>2010-08-04 18:16:39 +0200
commitcf0c6b78f132847a576ccd275cb0fffbf0a061ff (patch)
treed65ea404adebb5f98c5c44ac73665bc2cbf0418e /src/redis-cli.c
parent3a51bff0358c38162bc925ab25661e6090cf1161 (diff)
downloadredis-cf0c6b78f132847a576ccd275cb0fffbf0a061ff.tar.gz
Set tty before going into interactive mode to get non-pretty output when
the commands are read from stdin.
Diffstat (limited to 'src/redis-cli.c')
-rw-r--r--src/redis-cli.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/redis-cli.c b/src/redis-cli.c
index fc2238d48..0fef8cd97 100644
--- a/src/redis-cli.c
+++ b/src/redis-cli.c
@@ -496,7 +496,7 @@ int main(int argc, char **argv) {
config.raw_output = 0;
config.auth = NULL;
config.historyfile = NULL;
- config.tty = 1;
+ config.tty = isatty(fileno(stdout)) || (getenv("FAKETTY") != NULL);
config.mb_sep = '\n';
if (getenv("HOME") != NULL) {
@@ -522,7 +522,6 @@ int main(int argc, char **argv) {
repl();
}
- config.tty = isatty(fileno(stdout)) || (getenv("FAKETTY") != NULL);
argvcopy = convertToSds(argc+1, argv);
if (config.argn_from_stdin) {
sds lastarg = readArgFromStdin();