Reputation: 3256
When I use protocol('execution.txt').
and input some queries, I got some garbage characters in the output file. Is there any way to avoid these characters?
11 ?- beside(block2, X).
X = block3 [1m;[0m
[1;31mfalse.[0m
12 ?- beside(block4, X).
X = block7 [1m;[0m
X = block3 [1m;[0m
[1;31mfalse.[0m
13 ?- beside(block5, X).
[1;31mfalse.[0m
14 ?- above(block1,X).
X = block2 [1m;[0m
[1;31mfalse.[0m
15 ?- above(block2,X).
[1;31mfalse.[0m
16 ?- above(block6,X).
X = block5 [1m;[0m
X = block4 [1m;[0m
[1;31mfalse.[0m
17 ?- noprotocol.
Upvotes: 4
Views: 215
Reputation: 60034
those characters are ANSI terminal control sequences, used to highlight errors, etc etc. To disable it, input
?- set_prolog_flag(color_term, false).
before starting the protocol session. To disable permanently, place the same as a directive in your preference file. I.e. in Unix, place in ~/.plrc
:- set_prolog_flag(color_term, false).
If you use XPCE EMACS, you can edit preferences from menu
Edit\Prolog preferences
Upvotes: 4