Exit hook: run something when spyc quits

Open
#533 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

The issue names no implementation files or tests. First read the related issues #89, #63, and #73 to understand the existing startup command, cwd-on-quit behavior, and autocommand plans. The issue does not define what an exit hook must do; a concrete use case and agreed design are needed before implementation or a test for completion can be identified.

Written by the indexing model from the issue text.

Description

area:config needs-grooming type:feat

Split from #89, which shipped spyc -c <cmd> startup commands. The exit-hook half ("-F exit hooks") has no concrete use case yet, so its shape is still open.

Shapes considered

  • A Lua spyc.on("exit", fn) event, beside startup, dir_changed, project_changed and agent_status. Its handlers' requests have to apply before teardown, and the run needs a short budget so a slow handler can't hang quit; the worker's 30s ceiling is far too long there.
  • A -F <cmd> CLI flag, the mirror of -c: a : command run on quit. At that point a : command can do little beyond :!.

Related

  • #63, cwd export on quit (--cwd-file / $SPYC_CWD_FILE), is the concrete shell-integration need on quit, and doesn't need a general hook.
  • #73, autocommands (needs grooming), may be where a general event hook belongs.

Worth building once a use case names what an exit hook must do.

Dominant language
Rust
Stars
17
Forks
2
Avg merge
39m
Merged PRs (30d)
413

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Tripstack-Corp/spyc

All issues in Tripstack-Corp/spyc

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.