summaryrefslogtreecommitdiffstats
path: root/src/tui.c
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-05-31 09:37:04 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-05-31 09:37:04 +0200
commit04d28a7555405a15b3e93de769510b18c4a58c62 (patch)
treedd86a7e89fe2788117575dd3058ec1191222acbd /src/tui.c
parent0c84e94563533d21a2129cc5d11f8912fb395a6b (diff)
Send informational messages to stderr rather than the output when used
in non-interactive mode
Diffstat (limited to 'src/tui.c')
-rw-r--r--src/tui.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/tui.c b/src/tui.c
index 737eb40..81998cd 100644
--- a/src/tui.c
+++ b/src/tui.c
@@ -239,9 +239,9 @@ void ui_sc_msg(char * s, int type, ...) {
}
wrefresh(input_win);
- } else if (get_conf_value("output") != NULL && fdoutput != NULL) {
+ } else if (type == VALUE_MSG && get_conf_value("output") != NULL && fdoutput != NULL) {
fwprintf(fdoutput, L"%s\n", t);
- } else {
+ } else if (type == VALUE_MSG) {
if (fwide(stdout, 0) >0)
//wprintf(L"wide %s\n", t);
wprintf(L"%s\n", t);
@@ -249,6 +249,14 @@ void ui_sc_msg(char * s, int type, ...) {
//printf("nowide %s\n", t);
printf("%s\n", t);
fflush(stdout);
+ } else {
+ if (fwide(stderr, 0) >0)
+ //wprintf(L"wide %s\n", t);
+ fwprintf(stderr, L"%s\n", t);
+ else
+ //printf("nowide %s\n", t);
+ fprintf(stderr, "%s\n", t);
+ fflush(stderr);
}
va_end(args);
return;