Skip to content

Commit

Permalink
kernel: move readline specific code out of InitSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Jan 5, 2025
1 parent 19d38eb commit 8147e67
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
10 changes: 10 additions & 0 deletions src/sysfiles.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check warning on line 3239 in src/sysfiles.c

View check run for this annotation

Codecov / codecov/patch

src/sysfiles.c#L3239

Added line #L3239 was not covered by tests

// 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();
Expand Down
11 changes: 0 additions & 11 deletions src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8147e67

Please sign in to comment.