Without --tty, --python does nothing and there is no indication what is
going wrong. Either `-p` should imply --tty (see attached patch) or passing
one but not the other should print an error and exit with nonzero status.
From 2995852423e26490ef543da2972aea4d585e9d0c Mon Sep 17 00:00:00 2001
From: Hood Chatham <roberthoodchat...@gmail.com>
Date: Mon, 18 Aug 2025 14:03:04 +0200
Subject: [PATCH] Make -p/--python imply --tty

Without --tty, -p does nothing.
---
 gnubg.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnubg.c b/gnubg.c
index 68a223cd..8bd57fe0 100644
--- a/gnubg.c
+++ b/gnubg.c
@@ -4621,7 +4621,7 @@ main(int argc, char *argv[])
         {"lang", 'l', 0, G_OPTION_ARG_STRING, &lang,
          N_("Set language to LANG"), "LANG"},
         {"python", 'p', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, callback_parse_python_option,
-         N_("Start in Python mode or evaluate code in FILE and exit"), "FILE"},
+         N_("Start in Python mode or evaluate code in FILE and exit. Implies --tty."), "FILE"},
         {"quiet", 'q', 0, G_OPTION_ARG_NONE, &fQuiet,
          N_("Disable sound effects"), NULL},
         {"no-rc", 'r', 0, G_OPTION_ARG_NONE, &fNoRC,
@@ -4649,6 +4649,9 @@ main(int argc, char *argv[])
     };
     GError *error = NULL;
     GOptionContext *context;
+    if (fPython) {
+        fNoX = true;
+    }
 
 #if ! GLIB_CHECK_VERSION(2,36,0)
     g_type_init();
-- 
2.34.1

Reply via email to