aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-curses
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-08-16 16:53:08 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-08-16 16:53:08 +0300
commit37da097963cf0e988f0afc94bd63075965846ea0 (patch)
tree073f3387597d5a2a6c91ba18fa93f753be50b0ff /src/interface-curses
parent635ff6ecb2a172003ec614cade4cb1c683bb968e (diff)
downloadsciteco-37da097963cf0e988f0afc94bd63075965846ea0.tar.gz
UNIX curses: some clarifications on what is done during teco_interface_init_screen()
User messages printed in interative mode aren't currently fully preserved on stdout/stderr since they are redirected to /dev/null. Only messages that are not flushed out will be preserved. Unless you redirect stdout/stderr of SciTECO of course since in this case no redirection is necessary. This is probably tolerable esp. once we support multi-line messages in the UIs. At least it would be tricky to work around.
Diffstat (limited to 'src/interface-curses')
-rw-r--r--src/interface-curses/interface.c8
1 files changed, 8 insertions, 0 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);