# Is there a way to have \`\`zig build --watch\`\` replace its previous output?

**URL:** <https://ziggit.dev/t/is-there-a-way-to-have-zig-build-watch-replace-its-previous-output/7272>\
**Category:** Help\
**Tags:** build-system\
**Created:** [December 11, 2024, 1:00pm UTC](https://ziggit.dev/t/is-there-a-way-to-have-zig-build-watch-replace-its-previous-output/7272 "2024-12-11T13:00:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![markus](https://ziggit.dev/letter_avatar_proxy/v4/letter/m/b782af/32.png) [@markus](https://ziggit.dev/u/markus)\
**Post date:** [December 11, 2024, 1:00pm UTC](https://ziggit.dev/t/is-there-a-way-to-have-zig-build-watch-replace-its-previous-output/7272/1 "2024-12-11T13:00:47Z")

</div>

Is it possible to make `zig build --watch` just overwrite its previous output similarly to the one from just `zig build`, so that previous output is replaced by the new one?

---

<div class="post-metadata">

**Author:** ![dimdin](https://ziggit.dev/user_avatar/ziggit.dev/dimdin/32/1457_2.png) [@dimdin](https://ziggit.dev/u/dimdin)\
**Post date:** [December 11, 2024, 3:12pm UTC](https://ziggit.dev/t/is-there-a-way-to-have-zig-build-watch-replace-its-previous-output/7272/2 "2024-12-11T15:12:36Z")

</div>

Currently it is not possible.  
Watching feature and follow up work: [#20580](https://github.com/ziglang/zig/pull/20580)

* * *

A workaround, is the [`entr`](http://eradman.com/entrproject/) utility ([GitHub - eradman/entr: Run arbitrary commands when files change](https://github.com/eradman/entr)).  
`-c` flag, means:

> Clear the screen before invoking the utility specified in the command line. Specify twice to erase the scrollback buffer.

`entr` accepts from standard input a list of files or directories to watch.  
Example usage:

```zig
find . | entr -c "zig build test --summary new"

```
