watchexec Changelog

What's new in watchexec 2.1.1

Apr 30, 2024
  • Regression: -w, --watch was accidentally set to behave as -W (#828)

New in watchexec 2.1.0 (Apr 29, 2024)

  • New: -W, --watch-non-recursive for watching paths without also watching subfolders.
  • New: out-of-tree git repositories are now detected (i.e. when .git is a file rather than a folder)
  • Logs are also improved slightly with less nonsense at startup.

New in watchexec 2.0.0 (Apr 22, 2024)

  • Improvements:
  • New: --wrap-process=MODE lets you choose between using process groups, process sessions, or nothing at all. (#794)
  • New: the WATCHEXEC_TMPDIR environment variable can be used to customize where Watchexec will write temporary files, if for some reason your $TMPDIR is unwritable. (#814)
  • Fix: watchexec no longer creates a temporary file at startup. (#814)
  • Fix: the screen is no longer cleared on all events, only when starting a new process. (#809)
  • Experimental new feature:
  • As a treat, this release also features an experimental new option: -j or --filter-prog, which lets you write filter programs.
  • -j, --filter-prog EXPRESSION
  • Provide your own custom filter programs in jaq (similar to jq) syntax. Programs are given an event in the same format as described in --emit-events-to and must return a boolean. In addition to the jaq stdlib, watchexec adds some custom filter definitions:
  • path | file_meta returns file metadata or null if the file does not exist.
  • path | file_size returns the size of the file at path, or null if it does not exist.
  • path | file_read(bytes) returns a string with the first n bytes of the file at path. If the file is smaller than n bytes, the whole file is returned. There is no filter to read the whole file at once to encourage limiting the amount of data read and processed.
  • string | hash, and path | file_hash return the hash of the string or file at path. No guarantee is made about the algorithm used: treat it as an opaque value.
  • any | kv_store(key), kv_fetch(key), and kv_clear provide a simple key-value store. Data is kept in memory only, there is no persistence. Consistency is not guaranteed.
  • any | printout, any | printerr, and any | log(level) will print or log any given value to stdout, stderr, or the log (levels = error, warn, info, debug, trace), and pass the value through (so [1] | log("debug") | .[] will produce a 1 and log [1]).

New in watchexec 1.25.1 (Jan 5, 2024)

  • In this release:
  • Fix compatibility with 32-bit platforms (#730)
  • Fix bugs introduced by inconsistent path normalisation in optimised ignore handling (#759)

New in watchexec 1.25.0 (Jan 2, 2024)

  • In this release:
  • Startup performance improvements reducing the amount of directories visited when discovering ignore files. (#663 by @t3hmrman)
  • Improvements to handling of nested ignore files. (#745 by @thislooksfun)
  • Other changes:
  • Project origin detection tweaked a little to avoid some false positives. (#748)

New in watchexec 1.24.2 (Dec 20, 2023)

  • In this release:
  • Fix queueing behaviour (#726, #734, #735)
  • Other changes:
  • Optional eyra support (#728)

New in watchexec 1.24.1 (Dec 11, 2023)

  • Fix bug where @argfile arguments were parsed from beyond the -- separator. (#717, #720)
  • Fix bug where Ctrl-C would kill Watchexec, but not the command within (#716, #721)

New in watchexec 1.24.0 (Dec 9, 2023)

  • In this release:
  • New: start/stop messages are now in colour. Use --colour=never (--color also accepted) to disable, or the conventional always and auto. (#144, #237, #698)
  • New: --timings to print how long the command took. (#278, #698)
  • New: --quiet to disable printing any message (except warning and error logs). (#698)
  • New: --bell to ring the terminal bell on command end. (#238, #698)
  • New: --ignore-nothing to switch on all the --no-*-ignore flags. (#275, #625, #695)
  • New: --only-emit-events disables launching a command, and only prints events to stdout. Requires --emit-events-to to specify the format to print. This lets you obtain a stream of change events to handle directly rather than mediating via a command. (#676, #691)
  • New: --map-signal to map signals received by Watchexec to other signals sent to the command. (#151, #387, #710)
  • Change: --emit-events-to stdin and json-stdin modes are renamed to stdio and json-stdio respectively; the old names are aliased to preserve compatibility.
  • Other changes:
  • Uses the Watchexec library 3.0. (#601)
  • -w /dev/null disables watching any files. This is the literal string /dev/null, it won't detect the null device via links or fifos. (#601)
  • Running as PID1 (e.g. in Docker) is fully supported. (#140, #601, #624)
  • Performance improvements and bugfixes around reaping processes (via command-group 5). (#601)
  • Performance improvements and bugfixes around watching files (via notify 6). (#601)
  • Clear the screen before printing events, so --print-events and --clear can meaningfully be used together. (#601)
  • Hint that more or less help is available with long --help and short -h flags. (#601)
  • The PDF version of the manual page is gone, due to the tooling I used disappearing, and the general ugliness of its typesetting. (#710)

New in watchexec 1.23.0 (Aug 30, 2023)

  • In this release:
  • Don't search for project, global ignores when --no-project-ignore, --no-global-ignore are given respectively (#644, #643)
  • Add --no-discover-ignore which implies --no-project-ignore, --no-global-ignore, and --no-vcs-ignore and completely disables ignore discovery — useful on very large repos (#645)
  • Other changes:
  • Restore -d short flag (for --debounce) which got removed by accident (#635)
  • Clippy and dependency updates (#646)

New in watchexec 1.22.3 (May 14, 2023)

  • Handle nested gitignores properly (#580, #578)
  • Fix ignores on Windows (#580, #487)

New in watchexec 1.22.2 (Mar 22, 2023)

  • Paths on windows are normalised to unix format prior to being filtered. Windows-style patterns still work, but unix-style patterns will also now work (better).
  • Options that would send signals to processes are ignored on Windows, as we don't have support for non-kill signals there.

New in watchexec 1.22.1 (Mar 22, 2023)

  • In this release:
  • Fix --restart and --stop-timeout (#544, #548)
  • Fix process group not always being killed on restart (#274, #549)

New in watchexec 1.22.0 (Mar 19, 2023)

  • In this release:
  • New: --emit-events-to <mode> provides alternative ways to receive event details. To the environment mode, equivalent to the previous behaviour (and still the default), the file, stdin, json-file, and json-stdint modes are added. The watchexec-events crate can be used to parse the JSON format from Rust programs.
  • New: --fs-events <events> provides a more flexible way to filter which kinds of filesystem events cause command runs. The --no-meta option is now an alias to the configuration of this method omitting metadata changes.
  • New: --clear=reset performs a stronger screen clear (roughly equivalent to a tput reset).
  • Whole new extended help, manual page, and completion scripts (now for bash, elvish, fish, nu, and powershell in addition to zsh).
  • New: --manual shows the manual page, --help shows extended help (-h shows short help), --completion <shell> prints a completion script, such that even installing from source can benefit from the manpage or completions.
  • Other changes:
  • New: --filter-file and --ignore-file provide ways to load arbitrary ignore files, and also "filter files", which should be formatted like ignore files but patterns are treated the same as --ignore patterns.
  • New: --stop-signal lets you override the signal used to stop the process during a restart.
  • New: --stop-timeout lets you override the time waited between sending a signal and killing the process (which defaults to 30 seconds).
  • log-file's path argument is now optional. Providing the bare --log-file option uses the current directory. Further, the option also accepts a directory instead of a file, in which case it will create a file named watchexec.<timestamp>.log there.
  • poll is the new name for --force-poll (the old name exists as an alias), and the polling interval is now optional, with a default provided if no value is given.
  • All options that take durations now both take numbers in the unit described, but also expressions of the form 2mins 30s. This is a very similar format as systemd's durations, implemented by the humantime crate.
  • Removed support for the "tagged" filterer experiment.
  • The long --version option now prints extended version information, including the build date and commit hash (where that information is available). This is powered by a new crate, bosion.

New in watchexec 1.21.1 (Feb 15, 2023)

  • In this release:
  • Running as PID 1 (for examples, in a container) is now partially supported. Watchexec will properly exit, but may not behave exactly like an init program should. (#140, #497)
  • Fixed a critical bug due to Rust 1.66 changing a behaviour. (#494)
  • Other changes:
  • Added checksum files that are per-file as well as the bulk SUMS files, and added sha256 sums. (#500)
  • Added dist-manifest.json (#500)

New in watchexec 1.21.0 (Jan 9, 2023)

  • In this release:
  • New: --stdin-quit makes watchexec exit when STDIN closes, which avoids zombies when running with Elixir. (#440, #449)
  • Clearscreen improvements on systems without a functioning terminfo database. (#463)
  • Other changes:
  • MSRV bumped to 1.61.0
  • ZSH autocomplete fixes (#417)
  • Artifacts are not signed due to a process failure. A new more standard signing setup is being prepared for next release.

New in watchexec 1.20.6 (Sep 7, 2022)

  • Origins: detect Go, Zig, Pip
  • Docs: document known packages, and prioritise package managers in documentation
  • Deps: update notify to 5.0.0
  • Releng: use cargo-bins/release-pr
  • Releng: change tag scheme. CLI versions are tagged v1.2.3, all other crates are strictly {crate-name}-v1.2.3. Historical tag names are preserved as aliases.
  • Other changes:
  • Deps: update miette to 5.3.0
  • Deps: update git-config to 0.7.1
  • Releng: enable dependency updates
  • Releng: remove bors

New in watchexec 1.20.5 (Aug 4, 2022)

  • Fix: mimalloc was set as the global allocator in the watchexec library, instead of leaving it to downstreams. (#369)
  • Releng: s390x and ppc64le targets were added to be prebuilt. (#373)

New in watchexec 1.20.4 (Jul 1, 2022)

  • Remove CLI help tests. They'll be replaced with brand new integration testing that's not obnoxious. (#362, #363, #365)
  • Fix the install filenames for first-party RPM packagings, and possibly for DEBs as well. (#292, #364)

New in watchexec 1.20.3 (Jun 29, 2022)

  • Dependencies are set manually for first-party deb and rpm packages, so they should install without error. A note that these are provided on a best-effort basis and not tested; when available you should prefer your distribution's packaging. (#292, #358)

New in watchexec 1.20.2 (Jun 28, 2022)

  • Fix --restart (#346, #353)
  • Restore being able to use --signal with --restart (#353)
  • Have windows builds in releases again (#356)
  • Simplify logging levels, and make -v (info) more useful with actual, but sparse, information (#260, #354)

New in watchexec 1.19.0 (Apr 15, 2022)

  • Decrease default debounce timeout to 50ms (#168).
  • Add notice that the --shell default will be changing on Unix (#210).
  • New option --project-origin provides an override which can be useful when the project origin is misdetected, or if you want to stop watchexec from looking for ignore files in (some) parent directories (#246).
  • New option --workdir sets the command's working directory independent of Watchexec's.
  • New option --env (short: -E) adds environment variables to the command without affecting Watchexec itself.

New in watchexec 1.18.12 (Apr 12, 2022)

  • We no longer depend on libgit2 (#267)
  • Project origin resolution will no longer consider the home directory unless explicitly requested (#277)

New in watchexec 1.18.11 (Mar 27, 2022)

  • Bugfix: missed failure condition in project origin resolution (#271)

New in watchexec 1.18.10 (Mar 27, 2022)

  • Find project origin for all paths, including implicit . when no -w are passed. (#270)

New in watchexec 1.18.9 (Mar 18, 2022)

  • Partial revert of last release to fix a critical bug on Mac (#269)

New in watchexec 1.18.8 (Mar 16, 2022)

  • Upgraded to Notify pre.14
  • Internal change: kqueue backend is used on mac. This should reduce or eliminate some old persistent bugs on mac, and improve response times, but please report any issues you have!
  • Both the library's version and the CLI version are now reported in the -v logs
  • The library version is now specified with an exact (=) requirement, to avoid breakage
  • Documentation: ordering and deduplication in *_PATH variables (#262)

New in watchexec 1.18.7 (Mar 7, 2022)

  • Restored behaviour of */file filters matching file (1.17 compat) on unix. Note that this is incorrect behaviour that will go away for real in 2.0.
  • Restored behaviour of the combination of --exts and --filter (1.17 compat). This will stay.
  • Improved help text for inotify errors on Linux.

New in watchexec 1.18.6 (Feb 7, 2022)

  • The on_error handler gets an upgraded parameter which lets it upgrade (runtime) errors to critical.
  • summarize_events_to_paths now deduplicates paths within each variable.

New in watchexec 1.18.5 (Jan 30, 2022)

  • A file event in --on-busy-update=queue mode no longer prevents watchexec from quitting with Ctrl-C (#247)
  • The internal event queue is processed more efficiently, reducing the incidence of "no more capacity" errors (#241)
  • Sometimes a spurious "I/O error 10" or "no such process" error was emitted after hitting Ctrl-C, this is no more (#247)

New in watchexec 1.18.4 (Jan 26, 2022)

  • Fix: globset filterer should pass all non-path events (#248)

New in watchexec 1.18.3 (Jan 25, 2022)

  • Everything in Lib pre.7.
  • Fix: --shell should default to sh on unix, not none.
  • Doc: fix glob pattern for ignoring subdirs.

New in watchexec 1.18.2 (Jan 24, 2022)

  • Bugfix: invalid default value for --signal causing a crash on Windows.

New in watchexec 1.18.1 (Jan 23, 2022)

  • Bugfix: -e can now accept extensions with a leading period again.

New in watchexec 1.18.0 (Jan 18, 2022)

  • Verbose mode is now more configurable, with -v, -vv… up to -vvvv printing increasingly more logs. Note that -v already prints a lot more logs than in previous releases, and that the log format has changed. Additionally, the RUST_LOG environment variable can be set for even finer-grained logging.
  • --changes-only was renamed to --print-events, and its output changed. The former option persists as an alias for compatibility but will be removed eventually.
  • --no-ignore was renamed to --no-project-ignore for clarity. The former option persists as an alias for compatibility but will be removed eventually.
  • When the command ends with a non-0 exit code, or by a signal, or a Windows exception, a message is printed (e.g. [[Command exited with 63]]) (#37)
  • The --notify / -N option now works properly, and is therefore out of experimental.
  • Finding the "project origin" now considers other VCSs and many software development tooling conventions.
  • Ignore file loading has been improved, with support for:
  • Global VCS ignores (e.g. ~/.gitignore, ~/.bazaar/ignore) (#58)
  • Global Git excludes (i.e. as configured in git config core.excludesFile)
  • Local project git excludes (i.e. .git/info/exclude)
  • More VCS ignore files (for Mercurial, Darcs, Fossil, Bazaar) (nb gitignore syntax is assumed)
  • A watchexec-specific global ignore file in ~/.config/watchexec/ignore or as system-appropriate
  • Any files listed in the new WATCHEXEC_IGNORE_FILES environment variable (format is as for the system PATH variable)
  • Contextual ignores: git ignores won't be loaded for a Mercurial project, for example.
  • Correct ignore file parsing, notably around folder patterns.
  • The environment variables set on the command have a number of minor changes:
  • Paths are absolute
  • WATCHEXEC_COMMON_PATH is always set, with the common prefix of all paths
  • WATCHEXEC_OTHERWISE_CHANGED_PATH is new, for event kinds not covered by the other five (CREATED, META_CHANGED, REMOVED, RENAMED, WRITTEN)
  • Within each envvar, paths are sorted (with binary ordering).
  • Permission and other errors encountered when watching files are now reported with the concerned file path, when available. (#149)
  • Basic Pijul support was added.
  • Some errors are now not fatal: they are reported to STDERR but won't cause a crash.
  • Mimalloc is used for musl builds, which may improve performance and reduce memory use. This is only done on musl because its default allocator is so terrible. Non-musl builds use the system allocator.

New in watchexec 1.17.1 (Aug 1, 2021)

  • Experimental: --notify/-N flag sends a desktop notification when a change is observed (which may or may not trigger a command restart). While objectively the better behaviour would be to notify on command finish and vary the notification on exit status, we just can't do that at the moment with the current architecture.
  • RPM builds are temporarily disabled due some shifts in the ecosystem not being all caught up yet.

New in watchexec 1.17.0 (Jul 21, 2021)

  • 168 The default debounce time was further decreased to 100ms.
  • 145 New: @path-style argument parsing. (like rustc) You can now specify @argfile as the first argument to watchexec: this will read the file argfile and insert each line as an argument (no need to quote for whitespace, blank lines make empty arguments). This is a rudimentary way to have a configuration file, or as shorthand for established workflows; a more thorough file-based configuration system may be introduced later (#33, #136).
  • New: there’s now a website. Some of it is still being drafted, notably dedicated general documentation for this tool, but there’s already some specific documentation that’s been brought over and rewritten/improved, such as the inotify limitations and the glob patterns pages. Eventually a lot of the documentation that’s in readmes and issues will be moved there and improved.
  • 158 New: --no-process-group flag to disable process groups.
  • New: RPM packages are now available. These are built from the same binaries in the tarballs and DEB packages, so may not work properly for distros due to glibc versions or whatever. Untested as I don’t run RPM-based distros, tell me how it goes.
  • New: checksums (BLAKE3 and SHA512) and signatures (minisign) for first-party pre-built packages. See on the website.
  • New: fatal errors (panics) will now be displayed via eyre; for a bit of a friendlier look and easier to debug. Hopefully these aren't seen much though!
  • Packagers: if you’re reading these notes:
  • The website now has a JSON metadata file for every release and the latest, and that’s probably easier to parse than fighting it out with the API and the filenames. It also has the release notes and the checksums in nicely machine readable locations if you’re into that.
  • The archive format for tarballs will change to ZStandard (.tar.zst) at some point in the future (probably next year).

New in watchexec 1.16.1 (May 26, 2021)

  • Fix --clear with clearscreen 1.0.4 (ref watchexec/clearscreen#1)
  • This is a new CLI release only so that the binaries work, if you're using the library running cargo upgrade is sufficient.