# Swipl-win behaviour

**URL:** <https://swi-prolog.discourse.group/t/swipl-win-behaviour/9354>\
**Category:** Discussion\
**Created:** [October 21, 2025, 3:30pm UTC](https://swi-prolog.discourse.group/t/swipl-win-behaviour/9354 "2025-10-21T15:30:55Z")\
**Posts on this page:** 5\
**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:** [October 21, 2025, 3:30pm UTC](https://swi-prolog.discourse.group/t/swipl-win-behaviour/9354/1 "2025-10-21T15:30:55Z")

</div>

Doing a lot of Prolog development work that requires a lot of debugging, I’m trying to improve the `swipl-win` console. The git version already fixes a couple of memory management issues in xpce’s class `terminal` and fixes to the ANSI escape handling to make commandline editing work better (there still seem to be some flaws, probably related to history and paste ☹ , but so far I fail to get reproducible cases).

I have added a **Debug** menu to provide menu and keyboard shortcut for some common actions I tend to use while debugging. The idea is that this both makes (new) users aware of these features and make debugging more efficient for experienced users. Please check out this version (build from git source or for Windows users try the latest daily build).

The console is in inspired by the Linux [terminator](https://gnome-terminator.org/) console, providing similar splitting behaviour. Terminator however uses Ctrl-click to open a link. At the moment SWI-Prolog allows for simple (left) click. I find myself quite often unexpectedly opening links. Should we also move to Ctrl-click?

Comments on the current behaviour is welcome. What is missing? What is unclear?

If you experience crashes and use Linux or MacOS, please build using AddressSanitizer as follows (assuming source, from the top directory)

```prolog
mkdir build.asan
cd build.asan
../script/configure
(agree)
ninja

```

Now you can run `src/swipl-win` (without installing) from any directory you like. This version is a lot slower, but gives detailed analysis from most memory management issues. While SWI-Prolog itself is pretty clean, `xpce` is much less …

P.s. I tend to split the console while debugging, running queries in one half and using the other to manage spy points, edit locations, find things, etc.

---

<div class="post-metadata">

**Author:** ![CapelliC](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/capellic/32/17_2.png) [@CapelliC](https://swi-prolog.discourse.group/u/CapelliC)\
**Post date:** [October 22, 2025, 4:24pm UTC](https://swi-prolog.discourse.group/t/swipl-win-behaviour/9354/2 "2025-10-22T16:24:54Z")

</div>

Hi Jan

Running the latest daily build (version 9.3.32-15-g72cb050c7) on Win11.

When I ‘touch’ the Debug menu, the system freezes, so I cannot comment about this new feature.

But seems I found the cause of some issues, that randomly blocked my system:  
I detached the second monitor, and then all started to work better.

Allegated a screenshot that - I hope - will provide an insight about the issue.

 ![Screenshot 2025-10-22 103032](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/9/91d53164dd1ac2e2ddd40764763b07ae203dbaf7.png)

The behaviour wasn’t always the same… sometime it freezed or died without messages immediately, sometimes after a debugging session started, sometimes switching between 2 windows… kind of really random.

[edit]

I reattached the second monitor after a successful start of swipl-win, and I got the message

`?- SDL_GetDisplayUsableBounds(): Invalid display`

---

<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:** [October 22, 2025, 6:03pm UTC](https://swi-prolog.discourse.group/t/swipl-win-behaviour/9354/3 "2025-10-22T18:03:03Z")

</div>

Hmmm ☹ I may have found the issue behind the assertion error. The Debug menu issue reproduces here. Rather odd; one would assume this all to be platform independent ☹

---

<div class="post-metadata">

**Author:** ![CapelliC](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/capellic/32/17_2.png) [@CapelliC](https://swi-prolog.discourse.group/u/CapelliC)\
**Post date:** [October 23, 2025, 9:42am UTC](https://swi-prolog.discourse.group/t/swipl-win-behaviour/9354/4 "2025-10-23T09:42:36Z")

</div>

> [@jan](#):
>
> have found the issue behind the assertion error

Yes, the latest daily build works with the second monitor attached. Many thanks for the quick fix.

> [@jan](#):
>
> The Debug menu issue reproduces here

could be you mean: the issue **not** reproduces here ? My system still freezes touching the menu.

---

<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:** [October 23, 2025, 9:50am UTC](https://swi-prolog.discourse.group/t/swipl-win-behaviour/9354/5 "2025-10-23T09:50:09Z")

</div>

> [@CapelliC](#):
>
> > [@jan](#):
> >
> > The Debug menu issue reproduces here
> 
> could be you mean: the issue **not** reduces here ? My system still freezes touching the menu.

I mean I could reproduce it, but it was too complicated to fix quickly. I just pushed some patches that fixes this, so it should work in tomorrow’s daily build.

The issue was that thread\_signal/2 signals were not processed while the thread is reading from the Epilog window. That is now fixed (with help from ChatGPT 🙂 ). This makes signal handling consistent between Windows and non-Windows systems 🙂 .
