Skip to content

Commit

Permalink
Merge pull request #7944 from yorickvP/fix-curRepl
Browse files Browse the repository at this point in the history
NixRepl::mainLoop: restore old curRepl on function exit
  • Loading branch information
thufschmitt authored Apr 4, 2023
2 parents 523c3f7 + 5bb6e3b commit d93c151
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libcmd/repl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ void NixRepl::mainLoop()
el_hist_size = 1000;
#endif
read_history(historyFile.c_str());
auto oldRepl = curRepl;
curRepl = this;
Finally restoreRepl([&] { curRepl = oldRepl; });
#ifndef READLINE
rl_set_complete_func(completionCallback);
rl_set_list_possib_func(listPossibleCallback);
Expand Down

0 comments on commit d93c151

Please sign in to comment.