Did you know ... Search Documentation:
history.pl
PublicShow source
Source read_term_with_history(-Term, +Options)
Read a term guide by Options and maintain a history similar to most Unix shells.
Source list_history[private]
Write recorded history events using print_message/2.
Source prompt_history(+Prompt)[private]
Set the prompt using prompt1/1, substituting '~!' by the event number.
Source substitute(+Old, +New, +String, -Substituted) is semidet[private]
substitute first occurence of Old in String by New
Source add_to_history(+Line:atom, +Options) is det[private]
Add Line to the command line editing history. Line contains the query as an atom without the Prolog full stop.
 expand_history(+Raw, -Expanded)[private]
Expand Raw using the available history list. Expandations performed are:

!match % Last event starting <match> !n % Event nr. <n> !! % last event

Note: the first character after a '!' should be a letter or number to avoid problems with the cut.

Source get_last_event(-Chars) is semidet[private]
return last event typed as a list of characters without the Prolog full stop.
Source matching_event(+String, -Chars) is semidet[private]
Return first event with prefix String as a list of Prolog chars without trailing full stop.