Init.pl location

I’m back to using swipl after several years. I’m trying to remember where the startup file is. I installed on Linux Mint using the stable ppa just this morning. Apparently, .swiplrc isn’t used anymore and where the docs say the init.pl file should be, there is none.

Is there no init.pl until I create one? Am I looking in the wrong place?

Thanks

Yip. The simplest way is to start swipl-win and use the Settings → User init file menu. That will copy a skeleton with some useful (or not) suggestions in comments to the location of the init file and start the editor on it.

On all systems except Windows, the default is ~/.config/swi-prolog/init.pl, following the XDG standard.

Thanks. On Linux Mint installing swipl-win looks like a challenge. I created a init.pl manually which works great.

It is not part of the package on systems that do not yet have SDL3. For stable Ubuntu it will be part of 26.04 (it is part of the non-LTS releases since 25.04).

If you want the GUI (which IMO is quite useful), you have two options: build from source (including SDL3) or use the flatpak version (easy, but with some limitations, notable for interfacing with Java, Python or your own C/C++ code).

1 Like