'tspin -p empty.log' waits until file has content, which may never happen
AndydeCleyre opened this issue · 3 comments
Thanks for this project, it's great!
One unexpected behavior I've noticed (in 2.0.0) is:
$ rm -f empty.log
$ touch empty.log
$ tspin -p empty.log # hangs indefinitely
If I leave that hanging, and in a separate Zsh session run:
$ print -rl -- one two three >empty.log
then the first session with the hanging tspin
command prints
one
two
three
and exits.
I wouldn't expect tspin -p
to wait for any/more input -- is that intentional? I would expect instead for it to print nothing and exit immediately, in the case of an empty file.
Hi @AndydeCleyre and thanks for your detailed description.
This is indeed a bug. tspin -p
should exit immediately when it reaches the end of the file, like you expect.
Additionally, I think the behavior you're seeing is something you'd expect if you ran tspin --follow --print
(only it would run forever), which is currently unsupported, but I now see that it might be nice to have anyway.
Just released 2.1.0
. Will close this ticket, thanks for reporting it.