aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main.c
diff options
context:
space:
mode:
authorRobin Haberkorn <rhaberkorn@fmsbw.de>2026-01-24 16:29:23 +0100
committerRobin Haberkorn <rhaberkorn@fmsbw.de>2026-01-24 16:37:27 +0100
commit7ff541040edc3b3f8a25bb69e04ecb57cba12954 (patch)
tree36e3e6fd6edca9f05f0e6afe193f0f241c305907 /src/main.c
parent54858904a67e683483bdfb33c08fe9941ab16cf4 (diff)
GTK: fixed --detach and support stdout/stderr redirections
* We fork after command line arguments have been parsed, which is after gtk_get_option_group() has been called. This means that GTK was already initialized and it wasn't safe to continue after forking. * As a workaround, we now re-exec with the original argv array, so GTK can be properly reinitialized. Since we did not remove `--detach` from argv (and that would be nontrivial), it would fork again endlessly, so we use an environment variable $__SCITECO_DETACHED to guard against recursive forks. * Also, do not close stdin/stdout/stderr if has been redirected to a file, so you can now e.g. call `gsciteco -d >some-file`. * This was broken since v2.5.0.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 4d46817..0023c78 100644
--- a/src/main.c
+++ b/src/main.c
@@ -445,7 +445,7 @@ main(int argc, char **argv)
*/
teco_qreg_table_init(&teco_qreg_table_globals, TRUE);
- teco_interface_init();
+ teco_interface_init(argc, argv);
/*
* QRegister view must be initialized only now