From be2b87ed4dda865406096196804b784f4c293687 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Sat, 9 Mar 2024 23:59:50 -0800 Subject: add automated usage mode to the repl This is definitely not a stable thing, but it does feel slightly crimes to put it as an experimental feature. Shrug, up for bikeshedding. Change-Id: I6ef176e3dee6fb1cac9c0a7a60d553a2c63ea728 --- src/libcmd/repl.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/libcmd/repl.cc') diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index 5809ab285..9e5599152 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -121,6 +121,12 @@ std::string removeWhitespace(std::string s) return s; } +static box_ptr makeInteracter() { + if (experimentalFeatureSettings.isEnabled(Xp::ReplAutomation)) + return make_box_ptr(); + else + return make_box_ptr(getDataDir() + "/nix/repl-history"); +} NixRepl::NixRepl(const SearchPath & searchPath, nix::ref store, ref state, std::function getValues) @@ -128,7 +134,7 @@ NixRepl::NixRepl(const SearchPath & searchPath, nix::ref store, refstaticBaseEnv.get())) - , interacter(make_box_ptr(getDataDir() + "/nix/repl-history")) + , interacter(makeInteracter()) { } -- cgit v1.2.3