aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libcmd/repl.cc13
-rw-r--r--src/libexpr/eval.cc4
2 files changed, 12 insertions, 5 deletions
diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc
index f5abaad9b..bcd887d76 100644
--- a/src/libcmd/repl.cc
+++ b/src/libcmd/repl.cc
@@ -232,10 +232,19 @@ static std::ostream & showDebugTrace(std::ostream & out, const PosTable & positi
return out;
}
+static bool isFirstRepl = true;
+
void NixRepl::mainLoop()
{
- std::string error = ANSI_RED "error:" ANSI_NORMAL " ";
- notice("Welcome to Nix " + nixVersion + ". Type :? for help.\n");
+ if (isFirstRepl) {
+ std::string_view debuggerNotice = "";
+ if (state->debugRepl) {
+ debuggerNotice = " debugger";
+ }
+ notice("Nix %1%%2%\nType :? for help.", nixVersion, debuggerNotice);
+ }
+
+ isFirstRepl = false;
loadFiles();
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 309b9f103..a1782dcad 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -887,12 +887,10 @@ void EvalState::runDebugRepl(const Error * error, const Env & env, const Expr &
if (error)
{
- printError("%s\n\n", error->what());
+ printError("%s\n", error->what());
if (trylevel > 0 && error->info().level != lvlInfo)
printError("This exception occurred in a 'tryEval' call. Use " ANSI_GREEN "--ignore-try" ANSI_NORMAL " to skip these.\n");
-
- printError(ANSI_BOLD "Starting REPL to allow you to inspect the current state of the evaluator.\n" ANSI_NORMAL);
}
auto se = getStaticEnv(expr);