Running two instances of
swipl on Windows 10 at the same time. One has the original code that works and the other I am using with modified code.
Since the test are identical and predicates are almost identical running a test in the wrong instance can sometimes cause a loss of time because I mistakenly believe a modified predicate passed a test and in fact did not because I ran the test in the wrong instance.
So my quick and simple way to resolve this was to add a
this/1 fact to each source code file.
?- this(X). X = original.
?- this(X). Correct to: "a_module:this(X)"? yes X = modifying.
Other ideas I looked at to see if they already existed were
- A Prolog flag expecting something to identify the source code file name.
- A command line option that would modify the Windows title bar running swipl, but in doing a summary skim of the documentation did not see anything that could work, but could have missed something.
- Changing the background color.
The solution that would be nicest is to just have the name of the file or the value of this/1 automatically added to the title bar.
Any one else doing something quick and easy to distinguish multiple instances of swipl?
The current way I start
swipl is by clicking on an icon in the task bar which invokes
"C:\Program Files\swipl\bin\swipl-win.exe" --win_app
With the task bar icon multiple instances can be started but they all start with the same command and thus create the same title bar.
Using window_title/2 as noted by Jan and using window_title/2 as a directive
will automatically set the title when the code is loaded.