$ swipl --no-signals
Welcome to SWI-Prolog (threaded, 64 bits, version 8.2.2)
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).
?- on_signal(int, O, O).
O = default.
?- current_prolog_flag(os_argv, X).
X = [swipl, '--no-signals'].
I reproduce that; it’s only in binaries in which I’m embedding the Prolog engine that I’m finding it difficult to disable signals.
edit: and in that case, printing all solutions to a(X), where
Strange. I’d first try to get os_argv and validate that. Note that you do need to make sure that the argument vector you pass to PL_initialize() remains valid during the execution of Prolog. If this doesn’t help, please supply short complete code we can compile and run.
This reproduces. I pushed some changes to make the --no-signals propagate through creating a saved state. Besides updating to the git version your best option is probably to use on_signal/3 to disable handling the signals you do not want Prolog to catch.