Atterpac/gaps and improvements#22
Merged
Merged
Conversation
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.
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.
Pause/resume, delay_next, watched_extension fix
Changes
Bug fix: empty
watched_extensionwatched nothingEmpty
WatchedExtenmadeshouldIgnorereject every path, so the default config and bareCLI never reloaded. Now empty = watch all files (incl. extensionless). Added the missing
zero-value test cases.
delay_nextnow implementedWas parsed onto
Executebut dropped before reachingProcess— did nothing. Wired throughAddProcessWithDelay; pauses for the configured ms after a step completes, before thenext starts. Context-aware (shutdown mid-delay aborts). Removed the old pre-start
time.SleeponBackgroundStruct.DelayNextthat double-counted.Opt-in pause/resume via Ctrl+Z
New
enable_pauseconfig (off by default). When set, traps SIGTSTP as a pause/resumetoggle: 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-pauseCLI flag.background.typenow warnsA
typeon thebackgroundblock is always dropped (runs as background regardless) — nowlogs a warning instead of silently ignoring.
Config surface
enable_pause: bool(default false)delay_next: int(ms) — now functional on every executewatched_extension: []— empty now means watch-allTests
Zero-value coverage added: nil
watched_extensionrows, end-to-end default-config reload,background.typedrop. Full suite green; builds on linux/darwin/windows.