libcmd/repl: factor inDebugger

The completions for debug commands is purposefully left out because it
is going to go away in the next changes.

Change-Id: Ibc78b7587de3f15857bb09a3a0732334693ad550
Signed-off-by: Raito Bezarius <raito@lix.systems>
This commit is contained in:
Raito Bezarius
2026-01-01 22:02:50 +01:00
parent 25d8495451
commit e798115c76
+6 -1
View File
@@ -150,6 +150,11 @@ struct NixRepl
StorePath getDerivationPath(Value & v);
ProcessLineResult processLine(std::string line);
bool inDebugger() const
{
return evaluator.debug && evaluator.debug->inDebugger;
}
void loadFile(const Path & path);
void loadFlake(const std::string & flakeRef);
void loadFiles();
@@ -292,7 +297,7 @@ ReplExitStatus NixRepl::mainLoop()
{
if (isFirstRepl) {
std::string_view debuggerNotice = "";
if (evaluator.debug && evaluator.debug->inDebugger) {
if (inDebugger()) {
debuggerNotice = " debugger";
}
notice("Lix %1%%2%\nType :? for help.", Uncolored(nixVersion), debuggerNotice);