Fix quick-actions failing to spawn outside the plugin's install dir#23
Merged
Conversation
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 <launch dir> 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
Quick Actions (
prefix+down) failed to open from any directory except the plugin's own install dir, while Projects (prefix+up) always worked. The herdr server log showed it every time:Root cause
The manifest registers the picker panes with a relative command,
["./bin/herdr-plus", …], which herdr resolves against the pane's working directory.--cwd→ the pane runs in the plugin's dir →./bin/herdr-plusresolves. ✅--cwd <launch dir>(quickactions.go) → herdr resolved./bin/herdr-plusagainst e.g.~/.dotfiles→ spawn fails. ❌Fix
Remove the
--cwdblock fromlaunchQuickActions(). It was purely cosmetic — the launch directory still reaches the picker and every action it runs throughHERDR_PLUS_CTX→ctx.WorkDir, which sets:cmd.Dir(action.go:178-179), and.herdr-plus/quick-actions/lookup (quickactionspicker.go:389).So actions still run in your launch directory; only the (unused) pane cwd changes, letting the relative binary path resolve exactly like projects. Added a comment so it doesn't get reintroduced.
Verified
go build/go vet/go test ./...all green.--cwd.Diagnosed from a herdr server log on a machine where the plugin was installed outside its source tree (credit to the diagnosis Spicer relayed).