Welcome to SWI-Prolog (threaded, 64 bits, version 9.1.14-41-g41ac4a569)
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).
% The graphical front-end will be used for subsequent tracing
[trace] ?- print_term([a,b,c],).
I realised what the problem is (I think). I use Visual Studio Code, and have the SWI-Prolog extension. To run code, I type swipl in the VS terminal, and then call my predicates as I would if running the SWI-Prolog app.
If I run the installed SWI-Prolog app (where I get the interface) then indeed gtrace works fine. It’s only when I try it in the VS terminal that it doesn’t work.
Any idea how I run it from the VS terminal?
For the record, I’m running version 9.0.4 on Win11, and did do a full installation.
Actually, this might be possible these days. In the past you could not run a GUI from the commandline swipl.exe as this requires both the Windows message loop and synchronous read from the console. Since quite some years though, the IDE tools run in their own thread that (thus) also runs the message loop. So, you might be able to do
It works if you follow Jan’s suggestion. I also use VS Code and I found it almost miracolous when, launching a prolog file, XQuartz started (on MacOS). Although I know there’s nothing miracolous (in the end if it works from the Terminal why shouldn’t it work from the VS terminal…)