From ffde7e77cb0bc2972c14b9303e650005bfea19ef Mon Sep 17 00:00:00 2001 From: Spicer Matthews Date: Mon, 15 Jun 2026 23:20:30 -0700 Subject: [PATCH] Fix quick-actions failing to spawn outside the plugin's install dir The quick-actions overlay pane is registered in the manifest with a relative command (./bin/herdr-plus), which herdr resolves against the pane's working directory. launchQuickActions passed --cwd when opening the pane, so herdr looked for ./bin/herdr-plus inside the launch directory (e.g. ~/.dotfiles) and failed to spawn the picker: ERROR herdr::pane: failed to spawn ... Unable to spawn /Users/.../.dotfiles/./bin/herdr-plus because it does not exist It only worked when launched from the plugin's own install dir. The projects pane never set --cwd, which is why projects (prefix+up) always worked while quick-actions (prefix+down) failed everywhere else. Drop the --cwd block so quick-actions resolves the binary the same way projects does. The flag was purely cosmetic: the launch directory still reaches the picker and every action through HERDR_PLUS_CTX (ctx.WorkDir), which sets each command's cmd.Dir (action.go) and the per-repo action lookup (quickactionspicker.go). Added a comment so it isn't reintroduced. --- quickactions.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/quickactions.go b/quickactions.go index 2e75c6e..918d2c9 100644 --- a/quickactions.go +++ b/quickactions.go @@ -40,11 +40,15 @@ func launchQuickActions() { // Hand the launch context to the picker as a single shell-safe env var. "--env", "HERDR_PLUS_CTX=" + enc, } - // Run the overlay pane's shell in the launching directory too, so the picker - // and anything it spawns default to the right place. - if ctx.WorkDir != "" { - args = append(args, "--cwd", ctx.WorkDir) - } + // IMPORTANT: do not add --cwd here. The manifest registers this pane with a + // relative command (./bin/herdr-plus), which herdr resolves against the pane's + // working directory — so the pane must run in the plugin's own install dir for + // that path to resolve. Passing --cwd made herdr look for + // ./bin/herdr-plus inside the launch directory and fail to spawn the picker. + // The launch directory still reaches the picker — and the action it runs — + // through HERDR_PLUS_CTX (ctx.WorkDir), which sets each command's cmd.Dir and + // the per-repo action lookup. So --cwd was purely cosmetic; dropping it loses + // nothing and matches how the projects pane (which never set it) already works. cmd := exec.Command(herdr, args...) cmd.Stdout = os.Stdout