Commit ae77016e authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

Add a newline to tty output after every reply

parent 5d15b520
...@@ -226,7 +226,7 @@ static int cliReadReply(int fd) { ...@@ -226,7 +226,7 @@ static int cliReadReply(int fd) {
case '*': case '*':
return cliReadMultiBulkReply(fd); return cliReadMultiBulkReply(fd);
default: default:
printf("protocol error, got '%c' as reply type byte\n", type); printf("protocol error, got '%c' as reply type byte", type);
return 1; return 1;
} }
} }
...@@ -294,12 +294,8 @@ static int cliSendCommand(int argc, char **argv, int repeat) { ...@@ -294,12 +294,8 @@ static int cliSendCommand(int argc, char **argv, int repeat) {
} }
retval = cliReadReply(fd); retval = cliReadReply(fd);
if (retval) { if (!config.raw_output && config.tty) printf("\n");
return retval; if (retval) return retval;
}
if (!config.raw_output && config.tty) {
printf("\n");
}
} }
return 0; return 0;
} }
......
...@@ -36,9 +36,11 @@ start_server {tags {"cli"}} { ...@@ -36,9 +36,11 @@ start_server {tags {"cli"}} {
} }
proc test_interactive_cli {name code} { proc test_interactive_cli {name code} {
set ::env(FAKETTY) 1
set fd [open_cli] set fd [open_cli]
test "Interactive CLI: $name" $code test "Interactive CLI: $name" $code
close_cli $fd close_cli $fd
unset ::env(FAKETTY)
} }
proc run_nontty_cli {args} { proc run_nontty_cli {args} {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment