Skip to content

(PR#10534 capture.output(), truncated last output without

1 message · Brian Ripley

#
This only happens if 'file' is a text connection, and is the expected 
behaviour in that case: you cannot capture an incomplete line to a text 
connection.

There seems no reason to break the documented behaviour in other cases to 
change something that you consider to a bug when file=NULL and the user 
does not produce complete output.  It would be possible to make use of 
isIncomplete() to add a final newline only where needed to complete a 
line.  E.g. use

     if(inherits(file, "textConnection") && isIncomplete(file)) cat("\n")
On Sat, 29 Dec 2007, phgrosjean at sciviews.org wrote: