From 5f4b8537644e9cb1404980e927210cd9acce0f72 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Tue, 29 Jul 2025 15:16:34 -0500 Subject: [PATCH 1/6] fix mount failure when path contains a space --- CHANGELOG.md | 1 + repertory/repertory/src/ui/handlers.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da223299..57897ff5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ### Changes from v2.0.6-release * Fixed `.` and `..` incorrectly being reported as files in remote Linux mounts +* Fixed UI mount failure when path contains a space ## v2.0.6-release diff --git a/repertory/repertory/src/ui/handlers.cpp b/repertory/repertory/src/ui/handlers.cpp index 97b6e8f6..f71eeb24 100644 --- a/repertory/repertory/src/ui/handlers.cpp +++ b/repertory/repertory/src/ui/handlers.cpp @@ -728,7 +728,11 @@ auto handlers::launch_process(provider_type prov, std::string_view name, args.insert(std::next(args.begin(), 2U), "start"); args.insert(std::next(args.begin(), 3U), ""); args.insert(std::next(args.begin(), 4U), "/MIN"); - args.insert(std::next(args.begin(), 5U), repertory_binary_); + if (utils::string::contains(repertory_binary_, " ")) { + args.insert(std::next(args.begin(), 5U), "\"" + repertory_binary_ + "\""); + } else { + args.insert(std::next(args.begin(), 5U), repertory_binary_); + } #else // !defined(_WIN32) args.insert(args.begin(), "-f"); args.insert(args.begin(), repertory_binary_); From 17b7b093339761a8055c8a7ee8b5ac4c96534a02 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Wed, 30 Jul 2025 07:49:34 -0500 Subject: [PATCH 2/6] Create Windows installer #53 --- repertory.iss.in | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/repertory.iss.in b/repertory.iss.in index b6175feb..bf2ddb61 100644 --- a/repertory.iss.in +++ b/repertory.iss.in @@ -32,16 +32,19 @@ WizardStyle=modern function CheckAddPath(Param: string): boolean; var CurPath: string; + PathPos: Integer; begin - if not RegQueryStringValue(HKEY_LOCAL_MACHINE, + if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', - 'Path', CurPath) + 'PATH', CurPath) then begin - Result := True; + PathPos := Pos(';' + Param + ';', ';' + CurPath + ';'); + Result := PathPos = 0; + MsgBox('Path|' + CurPath + '|Param|' + Param + '|Pos|' + IntToStr(PathPos), mbInformation, MB_OK); exit; end; - Result := Pos(';' + Param + ';', ';' + CurPath + ';') = 0; + Result := True; end; [Languages] @@ -66,4 +69,4 @@ Filename: "msiexec.exe"; WorkingDir: "{app}"; Parameters: "/a winfsp-@WINFSP_VER [Registry] Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; \ ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app};"; \ - Check: CheckAddPath('{app}') + Check: CheckAddPath("{app}") From 1e7e304b4323774a4692b359998f8ef3b2342098 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Wed, 30 Jul 2025 07:49:58 -0500 Subject: [PATCH 3/6] Create Windows installer #53 --- repertory.iss.in | 1 - 1 file changed, 1 deletion(-) diff --git a/repertory.iss.in b/repertory.iss.in index bf2ddb61..9ffd4606 100644 --- a/repertory.iss.in +++ b/repertory.iss.in @@ -40,7 +40,6 @@ begin then begin PathPos := Pos(';' + Param + ';', ';' + CurPath + ';'); Result := PathPos = 0; - MsgBox('Path|' + CurPath + '|Param|' + Param + '|Pos|' + IntToStr(PathPos), mbInformation, MB_OK); exit; end; From d8774ba7f70fa10bf15cd4e5c319192cb91601d2 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Wed, 30 Jul 2025 07:52:54 -0500 Subject: [PATCH 4/6] Create Windows installer #53 --- repertory.iss.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repertory.iss.in b/repertory.iss.in index 9ffd4606..1f425ed4 100644 --- a/repertory.iss.in +++ b/repertory.iss.in @@ -68,4 +68,4 @@ Filename: "msiexec.exe"; WorkingDir: "{app}"; Parameters: "/a winfsp-@WINFSP_VER [Registry] Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; \ ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app};"; \ - Check: CheckAddPath("{app}") + Check: CheckAddPath(ExpandConstant('{app}')) From 53574866592f92477b820b3fafb76066d3e061c4 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Wed, 30 Jul 2025 07:56:11 -0500 Subject: [PATCH 5/6] fix mount failure when path contains a space --- repertory/repertory/src/ui/handlers.cpp | 26 ++++++++----------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/repertory/repertory/src/ui/handlers.cpp b/repertory/repertory/src/ui/handlers.cpp index f71eeb24..5fb35bc4 100644 --- a/repertory/repertory/src/ui/handlers.cpp +++ b/repertory/repertory/src/ui/handlers.cpp @@ -720,23 +720,17 @@ auto handlers::launch_process(provider_type prov, std::string_view name, recur_mutex_lock inst_lock(inst_mtx); if (background) { #if defined(_WIN32) - std::array path{}; - ::GetSystemDirectoryA(path.data(), path.size()); + args.insert(args.begin(), "--hidden"); - args.insert(args.begin(), utils::path::combine(path.data(), {"cmd.exe"})); - args.insert(std::next(args.begin()), "/c"); - args.insert(std::next(args.begin(), 2U), "start"); - args.insert(std::next(args.begin(), 3U), ""); - args.insert(std::next(args.begin(), 4U), "/MIN"); - if (utils::string::contains(repertory_binary_, " ")) { - args.insert(std::next(args.begin(), 5U), "\"" + repertory_binary_ + "\""); - } else { - args.insert(std::next(args.begin(), 5U), repertory_binary_); - } + boost::process::v1::child proc(repertory_binary_, + boost::process::v1::args(args), + boost::process::v1::std_out.close(), + boost::process::v1::std_err.close(), + boost::process::v1::std_in.close()); + proc.detach(); #else // !defined(_WIN32) - args.insert(args.begin(), "-f"); args.insert(args.begin(), repertory_binary_); -#endif // defined(_WIN32) + args.insert(std::next(args.begin()), "-f"); std::vector exec_args; exec_args.reserve(args.size() + 1U); @@ -745,10 +739,6 @@ auto handlers::launch_process(provider_type prov, std::string_view name, } exec_args.push_back(nullptr); -#if defined(_WIN32) - _spawnv(_P_DETACH, exec_args.at(0U), - const_cast(exec_args.data())); -#else // !defined(_WIN32) auto pid = fork(); if (pid < 0) { exit(1); From 5fc391e5c0eaaf14e51414352f665d7c057045f9 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Wed, 30 Jul 2025 11:21:56 -0500 Subject: [PATCH 6/6] spelling --- .cspell/words.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.cspell/words.txt b/.cspell/words.txt index 40be5f7a..dd30cc61 100644 --- a/.cspell/words.txt +++ b/.cspell/words.txt @@ -207,6 +207,8 @@ source_subdir spdlog spdlog_project st_ctim +startupinfoa +startupinfow static-libgcc static-libstdc++ stbuf