From 8147e67013563f3bd634a01614abc6a80e1f8247 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 4 Jan 2025 13:43:51 +0100 Subject: [PATCH] kernel: move readline specific code out of InitSystem --- src/sysfiles.c | 10 ++++++++++ src/system.c | 11 ----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/sysfiles.c b/src/sysfiles.c index 1428e193be..50c221dcf9 100644 --- a/src/sysfiles.c +++ b/src/sysfiles.c @@ -3234,6 +3234,16 @@ void InitSysFiles(void) setbuf(stderr, (char *)0); #ifdef HAVE_LIBREADLINE + // don't use readline if in Window mode (e.g. for XGAP) + if (SyWindow) + SyUseReadline = 0; + + // don't use readline if stdin is not attached to a terminal + // FIXME: disabled this, as it breaks certain workspaces (see also + // issue https://github.com/gap-system/gap/issues/5014) + //else if (!isatty(fileno(stdin))) + // SyUseReadline = 0; + if (SyUseReadline) { rl_readline_name = "GAP"; rl_initialize(); diff --git a/src/system.c b/src/system.c index e2d28a6069..a119ba7506 100644 --- a/src/system.c +++ b/src/system.c @@ -661,17 +661,6 @@ void InitSystem ( } -#ifdef HAVE_LIBREADLINE - // don't use readline if in Window mode (e.g. for XGAP) - if (SyWindow) - SyUseReadline = 0; - // don't use readline if stdin is not attached to a terminal - // FIXME: disabled this, as it breaks certain workspaces (see also - // issue https://github.com/gap-system/gap/issues/5014) - //else if (!isatty(fileno(stdin))) - // SyUseReadline = 0; -#endif - InitSysFiles(); // now that the user has had a chance to give -x and -y,