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

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?

Currently it is not possible.
Watching feature and follow up work: #20580


A workaround, is the entr utility (GitHub - eradman/entr: Run arbitrary commands when files change).
-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:

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