pactl: SUBSCRIBE add a newline after every json message
Right now, when calling pactl -f json subscribe
each JSON message is printed on the same line and never on a newline.
(I believe I overlooked this when I first added JSON support to pactl
)
An example:
$ pactl -f json subscribe
{"index":1012,"event":"new","on":"client"}{"index":66,"event":"change","on":"source"}{"index":47,"event":"change","on":"card"}{"index":1012,"event":"remove","on":"client"}{"index":65,"event":"change","on":"sink"}{"index":65,"event":"change","on":"source"}{"index":47,"event":"change","on":"card"}{"index":66,"event":"change","on":"source"}{"index":1013,"event":"new","on":"client"}{"index":1013,"event":"remove","on":"client"}{"index":1014,"event":"new","on":"client"}{"index":1014,"event":"remove","on":"client"}
This makes it very difficult for most command-line applications to parse and respond to the output, since they usually expect line terminations.
It's also technically invalid JSON: usually the newline separates JSON messages, but two objects on the same line (with no separator between them) is invalid in JSON.