Your app is the culprit here, or more technically the underlying output libraries. Roughly speaking, an output handle can be:
-
Completely unbuffered, so any and all writes to the file immediately go to the destination
-
Buffered, wherein there is a buffer of some size and writes to the file go to the buffer, which isn’t sent to the destination until the buffer is filled up
-
“Line” buffered, in which the buffer holds only a single line and so all output gets buffered until a newline is seen, and then the buffered data gets sent to the destination.
It’s not uncommon for the scheme that the library uses to change based on the situation it finds itself in. For example, the buffer for stdout
might be completely unbuffered when the library knows that the output handle is connected to a terminal, but line or fully buffered when it is not.
That helps your program more efficiently cooperate in shell pipes and re-directions between commands while being more “interactive” while you’re running it directly.
Sublime is just capturing the output as it’s being sent, so in order to have your program generate output to the build system while it’s running you need to do something like flush the handle at knows points or change the buffer size/scheme that the library is using to tell it how you want it to act.