# Ann: SWI-Prolog 9.3.25

**URL:** https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070
**Category:** Releases
**Created:** [June 25, 2025, 1:22pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070 "2025-06-25T13:22:52Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)
#### Post date: [June 25, 2025, 1:22pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/1 "2025-06-25T13:22:52Z")

</div>

Dear SWI-Prolog user,

It has been a while since the last release. That doesn’t mean nothing  
happened as you can find in the long ChangeLog below. Highlights:

- Fixed several reported issues

- Improved clause indexing performance, in particular for predicates  
with a lot of clauses where some argument has only a few possible  
values. In such cases failure on a value that does not appear in  
any clause could be slow.

- Many changes in (console) I/O handling, wait and (xpce) event  
dispatching.

- Added library(editline), the BSD command line editor to the Windows  
version. This provides saved history and Prolog-sensitive completion  
to `swipl.exe` running in the console.

- **Dropped 32-bit Windows support.** Everything has to end at some point.  
It is getting increasingly hard to get all dependencies (Python/Janus  
never existed for 32-bit). The upcoming SDL/Cairo/Pango based xpce  
no longer supports 32-bit systems.

- Updated the build docker for the Windows version to use Fedora 42 as  
base image.

The last four changes are all related to upgrading xpce and replacing the  
GUI versions (Qt and native Windows swipl-exe) by SWI-Prolog+xpce.

```
Enjoy --- Jan

```

# SWI-Prolog Changelog since version 9.3.24

- PORT: Discontinue 32-bit windows builds.

- PORT: Support library(editline) (libedit) on Windows. This provides  
cross-platform commandline editing with Prolog-sensitive completion.

- ADDED: Windows: tty\_size/2 to also work on Windows consoles.

- WASM: Deal with new PL\_prompt\_string() API

- MODIFIED: Signature for PL\_promot\_string() and PL\_prompt\_next() These  
API functions now use the Prolog stream as argument to facilitate  
better support for Windows.

- ADDED: `IOSTREAM*` control message to get the Windows `HANDLE`

- FIXED: wait\_for\_input/3: use Swinsock() from pl-stream.c rather than  
a local macro This ensures proper error messages if the input is not  
a socket.

- MODIFIED: `PL_dispatch()` and friends now use `IOSTREAM*` instead  
of `int`. This is a first step to merge simultaneous handling of  
console outout and GUI dispatching for POSIX systems and Windows to  
a common design.

- WINE: Waiting for windows console input now works for wine.

- PORT: Make installing `INDEX.pl` files work on Windows. Concurrency  
may cause sharing violations. This patch retries renaming the index  
file several times.

- FIXED: Possible early reclaim of closure blob after unwrapping  
a predicate. PL\_unregister\_atom() was called twice.

- ADDED: Incorporate epilog into the toplevel. These patches prepare  
for the XPCE based `swipl-win`. May be started by using the `sdl`  
branch of xpce and run as

- ADDED: ‘$run\_state’/1 to query the current run state Can be used to  
detect code is running as part of the cleanup hooks.

- BUILD: Use `SDL_VIDEODRIVER=dummy` for running Prolog steps This  
makes sure the new SDL based xpce does not try to open graphics and  
is harmless on other targets.

- FIXED: Move swipl-win history support to library(win\_menu). This  
library is loaded as source and thus conditional compilation applies.  
library(prolog\_history) is compiled to .qlf. Now the code is also  
where it belongs.

- FIXED: When generating `_X` variable names, avoid query variable names.  
Consider the below example by Jan Burse. Using \_A in the answer is  
at least confusing. We must not only skip variable names that appear  
in the projection, but also variable names from the query that are  
not in the projection.

- FIXED: Terminal REPL loop using thread\_exit(io\_error) on an io\_error  
during read.

- FIXED: Termination of a REPL loop due to error state of the streams  
This did not properly close the query, crashing the system in the  
thread cleanup.

- FIXED: thread\_join/2: could leave `L_THREAD` mutex locked on error.

- ADDED: Allow thread\_signal/2 to raise native signals by number.  
This can be used to raise e.g. SIGINT in a thread to debug it.

- FIXED: enable\_line\_editing/3 to avoid conditional compilation.  
This is needed to make library(threadutil) work as .qlf module.

- FIXED: write/1,2 to take rational number syntax from module `user`.  
Before, only write\_term/2,3 supported “natural” rational number syntax.

- FIXED: Make the stream macros `Suser_input` safe when called from a  
non-Prolog thread Called from a non-Prolog thread caused these macros  
to crash. They now return NULL. The main-thread I/O can be obtained  
using `Sinput`, `Soutput` or `Serror`.

- ADDED: Allow hooking into the terminal link generation.

- FIXED: Various details for the `sys` app

- ADDED: Prolog flag `linux`

- FIXED: QLF format to store references to predicates in the current  
module by functor. Otherwise, if a predicate is imported the clause  
will point at the import location, bypassing the predicate resolution  
that happens when loading the source.

- BUILD: Avoid cmake warnings.

- ENHANCED: jiti\_list/0,1 - Provide collision stats - Order predicates  
alphabetically - Use tty hyperlinks when supported to allow jumping  
to the definition

- FIXED: ansi\_hyperlink/3: Fix position logic Make sure the column admin  
is not updated when writing the escape sequences. This allows mixing  
with format/1-3 tag specifiers.

- ENHANCED: Make sure that small clause index tables have no collisions.

- ENHANCED: Use Fibonacci hashing for clause indexes.

- ENHANCED: Index performance on common arguments. Given a predicate  
with many clauses that has one or more arguments with only a few  
possible values and (thus) many clauses in the hash buckets for each  
of these values force fast failure when using a query with a value  
that does not appear in that argument.

- FIXED: #1364 nb\_set\_to\_list/2 could skip elements.

- FIXED: version/1: avoid redefined warning.

- FIXED: ansi\_get\_color/2: avoid errors on swipl-win (Qt)

## Package clib

- COMPAT: Use new PL\_dispatch() API.

- ENHANCED: uri\_file\_name/2, mode (+,-): Allow for file://host/…  
If host is the same as gethostname/1 reports.

## Package cpp

- PORT: Deal with new PL\_prompt\_string() and PL\_prompt\_next() API.

- COMPAT: Use new PL\_dispatch() API.

## Package http

- ENHANCED: Use url(URL) for HTTP startup message.

- FIXED: http\_time\_stamp/2 in mode (-,\_+).

- FIXED: json\_skip\_ws/3: Pass exception.

- FIXED: http\_open/3: when applying a transfer filter, do not close  
the output Instead, create a new stream pair from the transfer filter  
stream and the output stream.

- SECURITY: Make http handlers read remaining request data for Keep-alive  
When using a Keep-alive connection the core HTTP infrastructure now  
ensures that, if the request has a request body (`Content-length`)  
exactly this number of bytes is read from the input before returning  
the stream to the Keep-alive mechanism.

- FIXED: http\_open/3: only catch error(Formal, Context).

- FIXED: Multipart reader to update stream position data of  
parent stream. This is a tentative fix, lacking a test case.  
It still looses the line count/pos. That could be fixed by calling  
S\_\_fupdatefilepos\_getc() on all processed data.

## Package libedit

- PORT: Support Windows

- COMPAT: Update for new signature for PL\_prompt\_string() and  
PL\_prompt\_next()

- COMPAT: Use new PL\_dispatch() API.

- ENHANCED: el\_wrap/4 to raise an error if the stream is already wrapped.

- FIXED: Avoid memory leak on `FILE` structs created by `fdopen()`

- FIXED: el\_history/2: handling of setsize() was undefined.

- ADDED: Allow using the (integer) fd to specify the editline instance  
This allows accessing the history of other threads.

- ENHANCED: Sync the positions of the terminal streams.

## Package readline

- PORT: Deal with new PL\_promot\_string() and PL\_prompt\_next() APIs

- COMPAT: Use new PL\_dispatch() API.

## Package xpce

- COMPAT: Changed dispatch handling to pass an IOSTREAM that must  
be watched.

---

<div class="post-metadata">

### Author: ![ridgeworks](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/ridgeworks/32/886_2.png) [@ridgeworks](https://swi-prolog.discourse.group/u/ridgeworks)
#### Post date: [June 25, 2025, 2:06pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/2 "2025-06-25T14:06:23Z")

</div>

I’m still seeing [Terminal regression on 9.3.23, MacOS · Issue #1367 · SWI-Prolog/swipl-devel · GitHub](https://github.com/SWI-Prolog/swipl-devel/issues/1367) on 9.3.25. Am I alone? Is there some piece of config that I’m missing?

---

<div class="post-metadata">

### Author: ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)
#### Post date: [June 25, 2025, 2:41pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/3 "2025-06-25T14:41:53Z")

</div>

As commented on github, this does not reproduce for me (MacBook Air, MacOS 15.5). What happens on

```
?- [library(editline)].

```

---

<div class="post-metadata">

### Author: ![ridgeworks](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/ridgeworks/32/886_2.png) [@ridgeworks](https://swi-prolog.discourse.group/u/ridgeworks)
#### Post date: [June 25, 2025, 2:49pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/4 "2025-06-25T14:49:54Z")

</div>

> [@jan](#):
>
> As commented on github,

Where on github?

> [@jan](#):
>
> `?- [library(editline)].`

Not getting the point but (example with up-arrow key):

```prolog
$ /Applications/SWI-Prolog9.3.25.app/Contents/MacOS/swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 9.3.25)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- [library(editline)].
true.

?- ^[[A^[[A^[[A^[[A

```

As noted this only happens to me on 9.3.23 and later.

---

<div class="post-metadata">

### Author: ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)
#### Post date: [June 25, 2025, 3:10pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/5 "2025-06-25T15:10:00Z")

</div>

> [@ridgeworks](#):
>
> Not getting the point but (example with up-arrow key):

Library `editline` provides the (default) commandline editor that makes e.g., the up-arrow key work. There has been no change to this stuff for 9.3.24. There have been a lot of changes for 9.3.25, fixing bugs (see [Having all sorts of problems with libeditline - #13 by alanbur](https://swi-prolog.discourse.group/t/having-all-sorts-of-problems-with-libeditline/9053/13)), supporting Windows and modifications to the APIs that handle GUI events while waiting for the console.

Now, are we only talking about the arrow keys, or does the whole library not work? Does TAB completion work? Can you edit in the history using Emacs keys ^B/^F for backward/forward, ^P^N for up/down?

Anyone else facing this? Relevant info could be the MacOS version (libedit.dylib comes from the OS) and the console/terminal you are using.

**Edit** There have been changes for 9.3.22 that modify the conditions on when the library is actually enabled. Try calling

```
 ?- el_wrap.

```

Does this enable the arrow keys and editing? If so, please trace through `editline:el_wrap_if_ok` to see why it is not enabled.

---

<div class="post-metadata">

### Author: ![ridgeworks](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/ridgeworks/32/886_2.png) [@ridgeworks](https://swi-prolog.discourse.group/u/ridgeworks)
#### Post date: [June 25, 2025, 3:48pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/6 "2025-06-25T15:48:53Z")

</div>

> [@jan](#):
>
> Now, are we only talking about the arrow keys, or does the whole library not work? Does TAB completion work?

Lots of things don’t work:

- arrow keys
- forward delete
- option-click for line cursor positioning
- TAB completion (just outputs TAB, or 4 spaces)

> [@jan](#):
>
> Try calling
> 
> ```prolog
> ?- el_wrap.
> 
> ```
> 
> Does this enable the arrow keys and editing?

Prior to running `el_wrap` arrow keys etc. generate some character sequences like:

```prolog
?- ^[[A^[[B^[[C^[[D^[[D^[[Dl      

```

After executing `el_wrap` nothing gets output for these keys other than an audible beep. So something changed but not necessarily for the better.

> [@jan](#):
>
> Relevant info could be the MacOS version (libedit.dylib comes from the OS) and the console/terminal you are using.

All I know is that it worked on 9.3.22 and hasn’t worked since.

---

<div class="post-metadata">

### Author: ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)
#### Post date: [June 25, 2025, 4:09pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/7 "2025-06-25T16:09:58Z")

</div>

> [@ridgeworks](#):
>
> All I know is that it worked on 9.3.22 and hasn’t worked since.

That is only mildly useful ☹ For one thing, nothing changed to this package in version 9.3.23 and 9.3.24. For 9.3.22 changes where made to allow for creating `editline.qlf`, which implies we cannot enable/disable parts of the library using conditional compilation. That could affect whether or not the library is actually enabled.

It is really hard to say something sensible when behind a system where all works as expected. I’d read through the library and possibly trace a little to see what is going on. You can start Prolog ensuring this library is not loaded using

```
 swipl -Dno-readline

```

Now there should be no history editing. Now, I can load

```
?- [library(editline)].

```

And line editing should work. The library initializes itself by calling `el_wrap_if_ok/0`, so see why that does (not) work. I normally check it works by typing

```
?- statis<TAB>

```

which should expand to

```
?- statistics.

```

Not working arrow keys can have more reasons, such as the terminal capabilities not being detected properly. For that reason you can use ^P to get to the previous command. That should not depend on the terminal detection.

---

<div class="post-metadata">

### Author: ![ridgeworks](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/ridgeworks/32/886_2.png) [@ridgeworks](https://swi-prolog.discourse.group/u/ridgeworks)
#### Post date: [June 25, 2025, 5:43pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/8 "2025-06-25T17:43:43Z")

</div>

> [@jan](#):
>
> You can start Prolog ensuring this library is not loaded using
> 
> ```prolog
> swipl -Dno-readline
> 
> ```
> 
> Now there should be no history editing. Now, I can load
> 
> ```prolog
> ?- [library(editline)].
> 
> ```

So this is progress. Following this procedure, arrow keys, forward delete, cursor positioning, and TAB completion all work. In fact everything I normally do seems to be back in working order. As to why, I have no idea.

---

<div class="post-metadata">

### Author: ![joseph-vidal-rosset](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/joseph-vidal-rosset/32/2594_2.png) [@joseph-vidal-rosset](https://swi-prolog.discourse.group/u/joseph-vidal-rosset)
#### Post date: [June 29, 2025, 9:58am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/9 "2025-06-29T09:58:21Z")

</div>

Hi Jan,

I got this error:

```prolog
root@mx:/usr/local/swipl-devel/build# ninja
[405/1551] Building C object packages/xpce/CMakeFiles/plugin_pl2xpce.dir/src/win/display.c.o
FAILED: packages/xpce/CMakeFiles/plugin_pl2xpce.dir/src/win/display.c.o 
/usr/bin/cc -Dplugin_pl2xpce_EXPORTS -I/usr/local/swipl-devel/build/packages/xpce -I/usr/local/swipl-devel/packages/xpce/src -I/usr/include/freetype2 -I/usr/local/swipl-devel/src/os -I/usr/local/swipl-devel/src -O2 -gdwarf-2 -g3 -fPIC -fvisibility=hidden -Wall -DHAVE_CONFIG_H -DSWI -D __SWI_PROLOG__ -std=gnu11 -MD -MT packages/xpce/CMakeFiles/plugin_pl2xpce.dir/src/win/display.c.o -MF packages/xpce/CMakeFiles/plugin_pl2xpce.dir/src/win/display.c.o.d -o packages/xpce/CMakeFiles/plugin_pl2xpce.dir/src/win/display.c.o -c /usr/local/swipl-devel/packages/xpce/src/win/display.c
/usr/local/swipl-devel/packages/xpce/src/win/display.c: In function ‘getDPIDisplay’:
/usr/local/swipl-devel/packages/xpce/src/win/display.c:394:43: error: ‘NAME_dpi’ undeclared (first use in this function); did you mean ‘NAME_pie’?
  394 | Any rc = getClassVariableValueObject(d, NAME_dpi);
      | ^ ~~~~~~~
      | NAME_pie
/usr/local/swipl-devel/packages/xpce/src/win/display.c:394:43: note: each undeclared identifier is reported only once for each function it appears in
In file included from /usr/local/swipl-devel/packages/xpce/src/win/display.c:36:
/usr/local/swipl-devel/packages/xpce/src/win/display.c: At top level:
/usr/local/swipl-devel/packages/xpce/src/win/display.c:1254:6: error: ‘NAME_dpi’ undeclared here (not in a function); did you mean ‘NAME_pie’?
 1254 | IV(NAME_dpi, "[size|int]", IV_NONE,
      | ^ ~~~~~~~
/usr/local/swipl-devel/packages/xpce/src/h/kernel.h:895:35: note: in definition of macro ‘IV’
  895 | #define IV(n, t, f, g, s) { n, t, f, NULL, (Name) g, s }
      | ^
/usr/local/swipl-devel/packages/xpce/src/win/display.c:1272:6: error: ‘NAME_wmClass’ undeclared here (not in a function); did you mean ‘NAME_noClass’?
 1272 | IV(NAME_wmClass, "[name]", IV_BOTH,
      | ^ ~~~~~~~~~~~
/usr/local/swipl-devel/packages/xpce/src/h/kernel.h:895:35: note: in definition of macro ‘IV’
  895 | #define IV(n, t, f, g, s) { n, t, f, NULL, (Name) g, s }
      | ^
[410/1551] Building C object packages/xpce/CMakeFiles/plugin_pl2xpce.dir/src/win/frame.c.o
ninja: build stopped: subcommand failed.
root@mx:/usr/local/swipl-devel/build# 

```

Sorry to need help.  
All the best,  
Jo.

---

<div class="post-metadata">

### Author: ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)
#### Post date: [June 29, 2025, 6:54pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/10 "2025-06-29T18:54:43Z")

</div>

It happens when doing an incremental compilation if the set of “atoms” in xpce changes. Just to a clean build. A quick way around is probably

```
 rm packages/xpce/h/names.*
 ninja

```

This issue is fixed in the upcoming version.

---

<div class="post-metadata">

### Author: ![kwon-young](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/kwon-young/32/4841_2.png) [@kwon-young](https://swi-prolog.discourse.group/u/kwon-young)
#### Post date: [June 30, 2025, 11:02am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/12 "2025-06-30T11:02:54Z")

</div>

> [@jan](#):
>
> ` rm packages/xpce/h/names.*`

hum, completely off topic, but did you know that ninja has a clean tool ?

```bash
ninja -t clean packages/xpce/all

```

For anyone using ninja often, make sure to look up the other ninja “tools”:

```bash
$ ninja -t list                    
ninja subtools:
     browse browse dependency graph in a web browser
      clean clean built files
   commands list all commands required to rebuild given targets
     inputs list all inputs required to rebuild given targets
       deps show dependencies stored in the deps log
missingdeps check deps log dependencies on generated files
      graph output graphviz dot file for targets
      query show inputs/outputs for a path
    targets list targets by their rule or depth in the DAG
     compdb dump JSON compilation database to stdout
  recompact recompacts ninja-internal data structures
     restat restats all outputs in the build log
      rules list all rules
  cleandead clean built files that are no longer produced by the manifest

```

---

<div class="post-metadata">

### Author: ![joseph-vidal-rosset](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/joseph-vidal-rosset/32/2594_2.png) [@joseph-vidal-rosset](https://swi-prolog.discourse.group/u/joseph-vidal-rosset)
#### Post date: [June 30, 2025, 12:02pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/13 "2025-06-30T12:02:56Z")

</div>

Thanks Jan, it works now!

```prolog
100% tests passed, 0 tests failed out of 81

Total Test time (real) = 17.59 sec
root@mx:/usr/local/swipl-devel/build# ninja install
[34/35] Install the project...
-- Install configuration: "PGO"
-- Set runtime path of "/root/lib/swipl/bin/x86_64-linux/swipl" to "/root/lib/swipl/lib/x86_64-linux"
-- Set runtime path of "/root/lib/swipl/lib/x86_64-linux/libswipl.so.9.3.24" to "/root/lib/swipl/lib/x86_64-linux"
-- Set runtime path of "/root/lib/swipl/bin/x86_64-linux/swipl-ld" to "/root/lib/swipl/lib/x86_64-linux"

```

---

<div class="post-metadata">

### Author: ![swi](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@swi](https://swi-prolog.discourse.group/u/swi)
#### Post date: [July 3, 2025, 8:33pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/14 "2025-07-03T20:33:35Z")

</div>

I think this problem with arrow keys happens when you have readline enabled in your swiplrc. I have the following two lines in my swiplrc.

```prolog
:- set_prolog_flag(readline,readline).
:- rl_read_init_file('~/.inputrc').

```

and I have the same problem as @ridgeworks with arrows, etc not working.

but if I comment the above lines, the arrows/tab work again, but without my special readline configuration (of course).

---

<div class="post-metadata">

### Author: ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)
#### Post date: [July 4, 2025, 7:05am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/15 "2025-07-04T07:05:36Z")

</div>

> [@swi](#):
>
> `:- set_prolog_flag(readline,readline).`

It seems library(readline) is no longer functional. I have no clue since when this is the case as it is not the default for several years. Maybe you know?

In any case, the current development ask for some reconsiderations. Let me tackle that in a separate topic.

---

<div class="post-metadata">

### Author: ![swi](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@swi](https://swi-prolog.discourse.group/u/swi)
#### Post date: [July 4, 2025, 7:25pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/16 "2025-07-04T19:25:35Z")

</div>

> [@jan](#):
>
> I have no clue since when this is the case as it is not the default for several years. Maybe you know?

I didn’t keep track of the version I was using before it broke, but I think it is safe to assume that 9.3.22 was working fine. I assume the recent editline work for xpce somehow affected readline.

---

<div class="post-metadata">

### Author: ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)
#### Post date: [July 7, 2025, 7:17pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/17 "2025-07-07T19:17:00Z")

</div>

> [@swi](#):
>
> I didn’t keep track of the version I was using before it broke, but I think it is safe to assume that 9.3.22 was working fine. I assume the recent editline work for xpce somehow affected readline.

Good be. The current plan is to discontinue the GNU readline based command line editor. The question is whether that is acceptable. The main reasons are

- License issues (GNU readline is **GPL** , turning everything you run while using this library into GPL).
- GNU readline has always proven to be a hard thing to maintain, though in recent years it seems to have stabilized. But, there are several half-baked clones around that we cannot use. This requires quite a bit of CMake logic to avoid trying to use one of them ☹
- GNU readline can only have one instance and we’d like to use the same beast everywhere. I managed to get that working using libedit 🙂
- One command line editor means less maintenance.

So, how many people would get how unhappy if we discontinue libreadline?

---

<div class="post-metadata">

### Author: ![swi](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@swi](https://swi-prolog.discourse.group/u/swi)
#### Post date: [July 7, 2025, 8:27pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/18 "2025-07-07T20:27:40Z")

</div>

I have setup readline to do the following in prolog:

- use vi keybindings
- when I click ESC-`<right>` it goes to the end of the line and types `.<enter>`
- when I click ( it types `()` and leaves the cursor in between the parentheses
- when I click { it types `{}` and leaves the cursor in between the curly braces
- when I click [it types `[]` and leaves the cursor in between the brackets
- when I click " it types `""` and leaves the cursor in between the quotes

If I could do these with editline I am okay with switching.

---

<div class="post-metadata">

### Author: ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)
#### Post date: [July 8, 2025, 7:20am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/19 "2025-07-08T07:20:52Z")

</div>

> [@swi](#):
>
> If I could do these with editline I am okay with switching.

Have a look at `library(editline)`. You’ll see that it defines and binds commands from Prolog. You can define the multifile hook `editline:el_setup/1` to add your own commands.

It reads an init file based on the “program name” `swipl`. That can probably be used to use `vi`. That is surely possible as it is the default 🙂 Possibly we should also wrap part of `el_set()` to provide more control. I’m sure you can figure out what needs to be done to make you happy and and send patches 🙂

When I created the libedit interface, libedit was way less powerful than readline. For example, the `^R` history search was written in Prolog as it was not available. This seems built-in now. Also on my wish list is completion on variable names and smarter general completion. It now completes on atoms and file names without paying attention to the context of the thing being expanded.

---

<div class="post-metadata">

### Author: ![swi](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@swi](https://swi-prolog.discourse.group/u/swi)
#### Post date: [July 8, 2025, 8:12pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/20 "2025-07-08T20:12:42Z")

</div>

thanks! I’ll take a look at it!

---

<div class="post-metadata">

### Author: ![DewayneG](https://avatars.discourse-cdn.com/v4/letter/d/838e76/32.png) [@DewayneG](https://swi-prolog.discourse.group/u/DewayneG)
#### Post date: [September 25, 2025, 9:45pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-25/9070/21 "2025-09-25T21:45:14Z")

</div>

I would not be unhappy, as the BSD licence enables a wider distribution ability for anything that I may share without copyleft restriction; and retains conformance with the intent of the swipl licence 😉
