diff options
-rw-r--r-- | src/interface-curses/interface.c | 8 | ||||
-rw-r--r-- | src/interface.c | 7 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c index 381c188..b135c5c 100644 --- a/src/interface-curses/interface.c +++ b/src/interface-curses/interface.c @@ -597,6 +597,14 @@ teco_interface_init_screen(void) * redirect it. Otherwise, they are already redirected * (e.g. to a file) and writing to them does not * interrupt terminal interaction. + * + * This cannot of course preserve all messages written to stdout/stderr. + * Only those messages written before flushing will be preserved and + * be visible after program termination since they are still in a user- + * space stdio-buffer. + * All messages could only be preserved if we redirected to a temporary + * file and replayed it afterwards. It wouldn't preserve the order of + * stdout vs. stderr messages. */ if (isatty(1)) { teco_interface.stdout_orig = dup(1); diff --git a/src/interface.c b/src/interface.c index 8685990..aa7e00e 100644 --- a/src/interface.c +++ b/src/interface.c @@ -106,8 +106,11 @@ teco_interface_msg(teco_msg_t type, const gchar *fmt, ...) * Everything higher than TECO_MSG_USER is also terminated by LF. * * @fixme TECO_MSG_USER could always be flushed. - * This however makes the message disappear, though. - * We might also want to put flushing under control of the language instead. + * This however makes the message disappear on UNIX since stdout/stderr + * have been redirected to /dev/null. + * Also it would probably be detrimental for performance in scripts + * that write individual characters. + * Perhaps we should put flushing under control of the language instead. */ void teco_interface_stdio_msg(teco_msg_t type, const gchar *str, gsize len) |