From 3ffc98dfea6f34f80a43c7bec2bd85a5ec8f92a4 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 17 Mar 2016 18:16:19 -0400 Subject: [PATCH] CmdDiagnostics: Reports $EDITOR/$VISUAL --- src/commands/CmdDiagnostics.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/commands/CmdDiagnostics.cpp b/src/commands/CmdDiagnostics.cpp index fe5d5f47..ab1fc86a 100644 --- a/src/commands/CmdDiagnostics.cpp +++ b/src/commands/CmdDiagnostics.cpp @@ -120,6 +120,13 @@ int CmdDiagnostics (Log& log) << (env ? env : "-") << "\n"; + // Determine rc.editor/$EDITOR/$VISUAL. + char* peditor; + if ((peditor = getenv ("VISUAL")) != NULL) + out << " $VISUAL: " << peditor << "\n"; + else if ((peditor = getenv ("EDITOR")) != NULL) + out << " $EDITOR: " << peditor << "\n"; + out << "\n"; std::cout << out.str (); log.write ("info", out.str ());