Skip to content

Commit

Permalink
Merge pull request #18 from stassa/master
Browse files Browse the repository at this point in the history
Compilation dierectives to avoid editline/readline errors on windows.
  • Loading branch information
TeamSPoon authored Dec 20, 2024
2 parents 90d3fe2 + 7a7470a commit 9c729f8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions prolog/metta_lang/metta_repl.pl
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@
% ?- save_history.
% true.
%
:- if(is_win64).
% Dummy to avoid errors on windows.
save_history.
:- else.
save_history :-
% Get the current input stream.
current_input(Input),
Expand All @@ -163,6 +167,7 @@
;
% Otherwise, do nothing.
true).
:- endif.

%! load_and_trim_history is det.
% Loads and trims the REPL history if needed, and installs readline support.
Expand Down Expand Up @@ -2038,12 +2043,16 @@
% This installs readline/editline support, allowing for line editing and history during input.
:- dynamic(is_installed_readline_editline/1).
:- volatile(is_installed_readline_editline/1).

:- if(is_win64).
:-else.
install_readline_editline :-
% Get the current input stream.
current_input(Input),
% Install readline support for the current input.
install_readline(Input),
!.
:- endif.

%! el_wrap_metta(+Input) is det.
%
Expand Down

0 comments on commit 9c729f8

Please sign in to comment.