Skip to content

feat: Actions, named commands bound to keys in the Picker (#62) - #76

Merged
hammadmajid merged 7 commits into
mainfrom
feat/62-actions
Oct 1, 2026
Merged

hammadmajid merged 7 commits into
mainfrom
feat/62-actions

Conversation

@hammadmajid

Copy link
Copy Markdown
Contributor

What changed

  • New internal/action package: the Action type, the built-in registry (builtins, empty for now), Merge (user [actions.<name>] tables override a built-in field by field), key validation and the Runner interface with ExecRunner.
  • Config decodes [actions.*] and validates at load. Errors name the line: unknown key, esc and ctrl+c, a plain printable key without keys.vim, two Actions on one key, and a missing run.
  • The Picker dispatches Action keys before its own key map, so a binding overrides a navigation key. Plain printable keys only fire in vim list focus. A detached Action starts through the injected Runner and the Picker stays open; a failure to start shows on the footer's key line until the next key press. Any other Action quits the Picker with the Action in the new picker.Choice.
  • jump.Resolve runs a non-detached Action after the Picker quits, on /dev/tty for all three streams, records a Visit, prints the path only for jump = true with a zero exit, and passes a non-zero status on via jump.ExitError (the CLI exits with it, silently). Detached Actions record their Visit through a recording Runner wrapper.
  • CONTEXT.md defines Action; the README documents Actions.
  • Enter is unchanged (feat(picker): Enter is the remappable jump Action #63 moves it onto the Action map).

Verification

  • gofmt -l . empty, go vet ./... clean, go test ./... passes except the known fish cases of TestScriptExecution.
  • Tests: key and merge tables (internal/action), config line numbers (internal/config), key dispatch with a fake runner including the footer message (internal/picker), the Resolve flows with a fake runner (internal/jump), and ExecRunner against a fake tty file (path with a space and a quote, CDD_PATH, cwd, exit status, detached start and start failure).
  • Smoke test with a temporary XDG_CONFIG_HOME: a config binding ctrl+c fails with line 8: actions.bad: key: "ctrl+c" can never be bound; a valid one loads.

Closes #62

@hammadmajid
hammadmajid merged commit 1650cf9 into main Oct 1, 2026
@hammadmajid
hammadmajid deleted the feat/62-actions branch October 1, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Actions — run a command on the selected Project with a key

1 participant