From 906c58ac3821ce364096b7c7f2df80b67d9740b6 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 1 Dec 2025 10:11:18 -0500 Subject: #5083 Fallback to OS open handler in external editor when no editor is explicitly set (#5077) * Fallback to OS open handler in external editor when no editor is explicitly set Signed-off-by: Rye * Apply suggestion to use SystemRoot for windows OS root path in open handler Co-authored-by: Ansariel Hiller --------- Signed-off-by: Rye Co-authored-by: Ansariel Hiller --- indra/newview/llexternaleditor.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'indra/newview/llexternaleditor.cpp') diff --git a/indra/newview/llexternaleditor.cpp b/indra/newview/llexternaleditor.cpp index 3decd15bbd..193a42f9f6 100644 --- a/indra/newview/llexternaleditor.cpp +++ b/indra/newview/llexternaleditor.cpp @@ -44,8 +44,20 @@ LLExternalEditor::EErrorCode LLExternalEditor::setCommand(const std::string& env std::string cmd = findCommand(env_var, override); if (cmd.empty()) { - LL_WARNS() << "Editor command is empty or not set" << LL_ENDL; - return EC_NOT_SPECIFIED; + LL_INFOS() << "Editor command is empty or not set, falling back to OS open handler" << LL_ENDL; +#if LL_WINDOWS + static const std::string os_cmd = "%SystemRoot%\\explorer.exe \"%s\""; +#elif LL_DARWIN + static const std::string os_cmd = "/usr/bin/open \"%s\""; +#elif LL_LINUX + static const std::string os_cmd = "/usr/bin/xdg-open \"%s\""; +#endif + cmd = findCommand("", os_cmd); + if (cmd.empty()) + { + LL_WARNS() << "Failed to find OS open handler \"" << cmd << "\"" << LL_ENDL; + return EC_NOT_SPECIFIED; + } } string_vec_t tokens; -- cgit v1.3 From d718b2e5bd7e94660a1104d467a69d2714f12f0c Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 9 Jan 2026 14:57:39 -0500 Subject: secondlife/viewer#5083 Fix external editor default open handling failing to work on mac and windows --- indra/newview/llexternaleditor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llexternaleditor.cpp') diff --git a/indra/newview/llexternaleditor.cpp b/indra/newview/llexternaleditor.cpp index 193a42f9f6..c3aad4ee65 100644 --- a/indra/newview/llexternaleditor.cpp +++ b/indra/newview/llexternaleditor.cpp @@ -46,9 +46,13 @@ LLExternalEditor::EErrorCode LLExternalEditor::setCommand(const std::string& env { LL_INFOS() << "Editor command is empty or not set, falling back to OS open handler" << LL_ENDL; #if LL_WINDOWS - static const std::string os_cmd = "%SystemRoot%\\explorer.exe \"%s\""; + std::string os_cmd = LLStringUtil::getenv("SystemRoot", ""); + if (!os_cmd.empty()) + { + os_cmd.append("\\explorer.exe \"%s\""); + } #elif LL_DARWIN - static const std::string os_cmd = "/usr/bin/open \"%s\""; + static const std::string os_cmd = "/usr/bin/open -t \"%s\""; #elif LL_LINUX static const std::string os_cmd = "/usr/bin/xdg-open \"%s\""; #endif -- cgit v1.3