Hi,
the following patch (which is already part of debian testing, and thus already on my system) breaks awful.spawn.read_lines: https://github.com/pavouk/lgi/commit/70b85a6755eba1a63fd217755109f781e3570f58 (although I guess it's mostly my fault on depending on an uninitialized variable).
I mentioned this issue here https://github.com/pavouk/lgi/issues/118#issuecomment-158174895, but I don't thing that this really counts as a bug.
The problem is that in the C API an end-of-stream is signaled with a NULL pointer. Since this is of type string, lgi turns this into an empty string and now we cannot tell apart an empty line from end-of-file.
Some awesome test build showing that this will really cause problems:
I have no idea what to do about it, but it should be fixed before a release. Plus, reporting it here makes more people know about it. :-)
I just found https://bitbucket.org/lucashnegri/lgob. I haven't looked much at it, but from the description it sounds like it might be a possible replacement for lgi, if needed. However, I have no idea how to use it (it's a bit weak on the documentation side).
Edit: Except that this provides zero type safety and it's apparently quite easy to get memleaks, because things are passed around as pointers quite often... Oh and looking at the code, it screams "memleak!" a lot.
in case if any arch linux users wil be reading that, i've uploaded to aur lua-lgi-git in which it works fine:
https://aur.archlinux.org/packages/lua-lgi-git/
Fixed by https://github.com/awesomeWM/awesome/pull/787 :-)
that fix was not working for me, i was able to reproduce it with "top -o \\%CPU -b -n 1 -w 512 -d 0.05" (i could revert lgi version and check if it's reproducible with just top without any specific args)
statistics were captured, but not process list
Uhm, are you sure that it worked properly before? That commit fixed an issue where end-of-file was not detected before. Now, the code assumes that any empty line means end of file and that's why the empty line in top's output is interpreted as EOF.
Before the fix, the code went into an almost-endless-loop instead (100% CPU usage). This is why you get the "cannot reliably detect EOF"-warning.
before the patch it wasn't working too, it was working with some previous lgi version
Most helpful comment
in case if any arch linux users wil be reading that, i've uploaded to aur
lua-lgi-gitin which it works fine:https://aur.archlinux.org/packages/lua-lgi-git/