From a4aac7f88c59c97299027c9668461c637bbc6a72 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 17 Apr 2018 12:16:04 +0200 Subject: [PATCH] Handle arguments in $EDITOR Fixes #2079. --- src/nix/edit.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nix/edit.cc b/src/nix/edit.cc index 7eaa86e2f..c9671f76d 100644 --- a/src/nix/edit.cc +++ b/src/nix/edit.cc @@ -61,7 +61,7 @@ struct CmdEdit : InstallableCommand auto editor = getEnv("EDITOR", "cat"); - Strings args{editor}; + auto args = tokenizeString(editor); if (editor.find("emacs") != std::string::npos || editor.find("nano") != std::string::npos || @@ -72,7 +72,7 @@ struct CmdEdit : InstallableCommand stopProgressBar(); - execvp(editor.c_str(), stringsToCharPtrs(args).data()); + execvp(args.front().c_str(), stringsToCharPtrs(args).data()); throw SysError("cannot run editor '%s'", editor); }