>(Terry) Typing commands in the REPL, I can see output on the screen and it's also logged in the julia-stdout.txt file. Thanks!. Your code does log normal output. We have to extend it a little to log also error messages, but warnings are logged correctly.
>(Stefan) reading and writing to a REPL by reading and writing unframed inputs and output over a UNIX-style stream pair is fundamentally broken. I don't see, why it has to be fundamentally broken. If the REPL was written with print() calls, instead of display(), we would not have a problem. Or, if display() sent data to STDOUT like print(). We can live with a few unsupported features, like triple-quoted strings, but handling no output or catching error messages are easy. Even if I just enter "1)", which is unrepairable. The code I write and use myself does not have to be perfect, just good enough. The simple solution I posted last works for me 99.9% of the time, which I cannot claim for most commercial software.
