I’m old-fashioned and usually run my Prolog code under Emacs’
compile command. My compile-edit-run cycle includes using
swipl -c and then executing the generated file. When I do this, I see ANSI color control characters in the
*compilation* window. I’ve tried turning them off with this in my
~/.swiplrc, and by adding the same directive to my program, but that doesn’t help:
:- set_prolog_flag(color_term, false).
I’ve confirmed that this file is read, by putting a deliberate syntax error into it and observing that I get an error message … .which, of course, has ANSI color control characters in it.
I also see color when running under the Emacs terminal and also under the regular Ubuntu terminal, so I suspect that the problem has nothing to do with Emacs.
I see a similar problem when I run the program directly from the source, without the compilation step.
This is more than an æsthetic issue … it confuses Emacs’
compilation-next-error, which I could fix but that requires delving into some Elisp code with which I’m unfamiliar.
--no-tty doesn’t seem to help; and when I tried it with the
swipl -c command, I got
save_option 'no-tty' does not exist.)