How to display goal line number with trace (not gtrace)?

gtrace/0 nicely highlights goals in the source code.
trace/0 only shows the goal, without any file or line number information.
Is there a way to show line number information with trace/0?

1 Like

Technically, sure. Goals are printed using print_message/2 (called from C) using a term frame(FrameRef, Port, ProgramCounter). That is enough to not just print the goal, but a lot more using the primitives you can find in library(prolog_stack) and the GUI tracer code.

Iā€™d surely welcome better output, also using colors to make navigation easier.