Long files confuse `hwatch`
To reproduce: with hwatch 0.3.9 on Linux:
-
Download qq.tar.gz and unpack it. Update: I reuploaded the file, the previous one had an insane path inside the tar file
-
Run
hwatch cat qqorHWATCH= hwatch cat qq
On my machine, this causes hwatch freeze and no part of the file is ever printed. The file has color sequences in it; hwatch --color cat qq also freezes. less -R qq and watch --color cat qq work with no problems.
For illustration, here's the end of the file in less -R:

The file is obtained with jj log which is equivalent to git log. I usually use hwatch with jj log with no problems, but for this particular state of the repo something went wrong.
I may or may not try to investigate this myself in the near future.
I think I figured out the cause. The file is simply too long.
$ hwatch "head -n 500 qq" # Works
$ hwatch "head -n 700 qq" # Does not work
I think this should still be tracked as a bug. hwatch should handle large file, at least by failing gracefully or cutting them off when a file is too long.
Thanks!
I think this should still be tracked as a bug. hwatch should handle large file, at least by failing gracefully or cutting them off when a file is too long.
That's certainly true. I'll try to figure out how to fix it.
It certainly doesn't move...
In version 0.3.11, I tried to cat the output of git log --color=always and git log (3000 lines), but it doesn't seem to be working.
It stopped outputting after about 2487 lines, so there may be a problem with writing to memory. I'm suspecting the size of Buffer.
I think this process is probably the cause.
https://github.com/blacknon/hwatch/blob/6695b35046eb3dc662bc6aa2b039e2bd18037f16/src/exec.rs#L99-L115
Closed because it was applied in version 0.3.12. Thank you for issue!
It works beautifully now. No more need to add | head -n 300 to every command. Thank you!