Skip to content

Atterpac/gaps and improvements#22

Merged
atterpac merged 5 commits into
mainfrom
atterpac/gaps-and-improvements
May 30, 2026
Merged

Atterpac/gaps and improvements#22
atterpac merged 5 commits into
mainfrom
atterpac/gaps-and-improvements

Conversation

@atterpac
Copy link
Copy Markdown
Owner

Pause/resume, delay_next, watched_extension fix

Changes

Bug fix: empty watched_extension watched nothing
Empty WatchedExten made shouldIgnore reject every path, so the default config and bare
CLI never reloaded. Now empty = watch all files (incl. extensionless). Added the missing
zero-value test cases.

delay_next now implemented
Was parsed onto Execute but dropped before reaching Process — did nothing. Wired through
AddProcessWithDelay; pauses for the configured ms after a step completes, before the
next starts. Context-aware (shutdown mid-delay aborts). Removed the old pre-start
time.Sleep on BackgroundStruct.DelayNext that double-counted.

Opt-in pause/resume via Ctrl+Z
New enable_pause config (off by default). When set, traps SIGTSTP as a pause/resume
toggle: supervisor loop gates reloads while paused, applies one catch-up reload on resume if
a change arrived. Unix only (no-op on Windows). Exposed via Config.EnablePause,
WithEnablePause, and -pause CLI flag.

background.type now warns
A type on the background block is always dropped (runs as background regardless) — now
logs a warning instead of silently ignoring.

Config surface

  • enable_pause: bool (default false)
  • delay_next: int (ms) — now functional on every execute
  • watched_extension: [] — empty now means watch-all

Tests

Zero-value coverage added: nil watched_extension rows, end-to-end default-config reload,
background.type drop. Full suite green; builds on linux/darwin/windows.

atterpac added 5 commits May 30, 2026 15:17
An empty WatchedExten made shouldIgnore reject every path, so the default
config (and bare CLI) silently watched nothing and never reloaded. Treat an
empty filter as watch-all. Add the previously-missing zero-value cases: a nil
filter in the isWatchedExtension table, and an end-to-end watcher test driven
by a zero-value Ignore.
delay_next was parsed onto Execute but dropped on the way to Process, so it
did nothing for configured executes. Wire it through AddProcessWithDelay and
pause for the configured duration after a step completes, before the next one
starts (context-aware, so shutdown mid-delay aborts cleanly).

Also remove the one-off pre-start time.Sleep on BackgroundStruct.DelayNext,
which double-counted against the new trailing semantics.
When enable_pause is set, trap the terminal suspend signal (SIGTSTP) and use
it as a pause/resume toggle instead of suspending: the supervisor loop gates
reloads while paused and applies a single catch-up reload on resume if a change
arrived in the meantime. Off by default so normal Ctrl+Z behavior is preserved;
no-op on platforms without SIGTSTP (Windows). Exposed via Config.EnablePause,
WithEnablePause, and the -pause CLI flag.
A type set on the background block is always dropped (the background command
runs as a background process regardless), so surface it with a warning instead
of silently ignoring it. Lock the drop behavior with a test.
Add EnablePause to the README Config struct, correct the delay_next comment to
the trailing-pause meaning, note that an empty watched_extension watches all,
and surface all three in the basic example config.
@atterpac atterpac merged commit 35ffa40 into main May 30, 2026
8 checks passed
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.

1 participant