aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/repl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcmd/repl.cc')
-rw-r--r--src/libcmd/repl.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc
index 0d7ad63a7..ee3a6e268 100644
--- a/src/libcmd/repl.cc
+++ b/src/libcmd/repl.cc
@@ -412,6 +412,7 @@ ProcessLineResult NixRepl::processLine(std::string line)
<< " :l, :load <path> Load Nix expression and add it to scope\n"
<< " :lf, :load-flake <ref> Load Nix flake and add it to scope\n"
<< " :p, :print <expr> Evaluate and print expression recursively\n"
+ << " Strings are printed directly, without escaping.\n"
<< " :q, :quit Exit nix-repl\n"
<< " :r, :reload Reload all files\n"
<< " :sh <expr> Build dependencies of derivation, then start\n"
@@ -619,7 +620,11 @@ ProcessLineResult NixRepl::processLine(std::string line)
else if (command == ":p" || command == ":print") {
Value v;
evalString(arg, v);
- printValue(std::cout, v);
+ if (v.type() == nString) {
+ std::cout << v.string.s;
+ } else {
+ printValue(std::cout, v);
+ }
std::cout << std::endl;
}