Skip to content

Commit cc2a9bf

Browse files
authored
flush stdio before display (#999)
1 parent cc07f6d commit cc2a9bf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/inline.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ end
5757
for mime in ipy_mime
5858
@eval begin
5959
function display(d::InlineDisplay, ::MIME{Symbol($mime)}, x)
60+
flush_all() # so that previous stream output appears in order
6061
send_ipython(publish[],
6162
msg_pub(execute_msg, "display_data",
6263
Dict(
@@ -82,6 +83,7 @@ function display(d::InlineDisplay, M::MIME, x)
8283
if istextmime(M)
8384
d["text/plain"] = sx # directly show text data, e.g. text/csv
8485
end
86+
flush_all() # so that previous stream output appears in order
8587
send_ipython(publish[],
8688
msg_pub(execute_msg, "display_data",
8789
Dict("metadata" => metadata(x), # optional
@@ -92,6 +94,7 @@ end
9294
# output types, so that IPython can choose what to display.
9395
function display(d::InlineDisplay, x)
9496
undisplay(x) # dequeue previous redisplay(x)
97+
flush_all() # so that previous stream output appears in order
9598
send_ipython(publish[],
9699
msg_pub(execute_msg, "display_data",
97100
Dict("metadata" => metadata(x), # optional

0 commit comments

Comments
 (0)